Jump to content

Recommended Posts

  • 4 weeks later...
Posted

Hi,

 

WOL:

I use the one from here Depicus Wake On Lan Command Line

I have batch file like following been scheduled to run at 07:30am daily.

 

wolcmd 86e958d34119 10.5.10.55 255.255.255.0

wolcmd 606186e762a1 10.5.10.51 255.255.255.0

wolcmd 306167e958c8 10.5.10.56 255.255.255.0

wolcmd 3c626d087f3e 10.5.10.53 255.255.255.0

 

 

SHUTDOWN:

I use Windows built-in shutdown command with followings; this one is scheduled to run daily at 18:00

shutdown /s /t 5 /m \\pc1.mydomain.co.uk /c "System shutting down, Please save your work, Good-Bye"

shutdown /s /t 5 /m \\pc2.mydomain.co.uk /c "System shutting down, Please save your work, Good-Bye"

shutdown /s /t 5 /m \\pc1.mydomain.co.uk /c "System shutting down, Please save your work, Good-Bye"

 

 

For WOL I export the dhcp lease to csv then import it on MS Excel then concatenate with wolcmd command.

  • Thanks 1
  • 3 weeks later...
Posted
Hi,

 

WOL:

I use the one from here Depicus Wake On Lan Command Line

I have batch file like following been scheduled to run at 07:30am daily.

 

wolcmd 86e958d34119 10.5.10.55 255.255.255.0

wolcmd 606186e762a1 10.5.10.51 255.255.255.0

wolcmd 306167e958c8 10.5.10.56 255.255.255.0

wolcmd 3c626d087f3e 10.5.10.53 255.255.255.0

 

 

SHUTDOWN:

I use Windows built-in shutdown command with followings; this one is scheduled to run daily at 18:00

shutdown /s /t 5 /m \\pc1.mydomain.co.uk /c "System shutting down, Please save your work, Good-Bye"

shutdown /s /t 5 /m \\pc2.mydomain.co.uk /c "System shutting down, Please save your work, Good-Bye"

shutdown /s /t 5 /m \\pc1.mydomain.co.uk /c "System shutting down, Please save your work, Good-Bye"

 

 

For WOL I export the dhcp lease to csv then import it on MS Excel then concatenate with wolcmd command.

Anyone build a script that uses depicus or other WOL like that for a simple script file that uses DHCP to get the MAC addresses so they don't need to be hard-coded into the script?

Posted (edited)

I done a few powershell scripts for WOL, shutdown, restart and ping to groups of machines (groups are defined in txt file with ip/machinename and mac, name used for shutdown, mac used for WOL.

 

I've attached my scripts, I just relooked at WOL script it may need to be updated to allow you to specify broadcast address (or just replace the one hardcoded), but its a pretty easy change.

 

I was also in the process last year of writing a gather script which gets wmi info off machines (pretty much anything you can think of: macs, bios s/n), also wrote a custom MOF to get installed apps as the WMI is surpose to be a bit dodgy. I would have love to finish it but got higher priority things. I may be willing to part with the gather work i did but its very much hacked work in progress.

 

1 more thing if your on same subnet you can use something like nmap to get mac ids for ips

 

Hope this helps

 

Mike

ps_scripts.zip

Edited by mikeyd101
  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...