so Im administering 100 desktop PCs at a local university in the pacific (dot in the map) and my boss has told me to write a script to carry out an automated shutdown of all computers at 10pm. I've created a batch file with the "shutdown /s" command but the only automated solution I have found so far is Task Scheduler and honestly doing the Task Scheduler settings on every computer is not very feasible. Is there any other more efficient way to write a script with scheduled configs to run the bat file. Sorry if this sounds very simple to you all or maybe Im posting in the wrong group or if this is a duplicate, please point me towards the right direction. Solutions are very welcome.
Asked
Active
Viewed 62 times
1 Answers
0
Can you not use the /m switch on shutdown to remotely invoke this in a loop of the machines you want to shutdown, something like
for /F "tokens=*" %%A in (names.txt) do shutdown /m \\%%A /s
where yourfile.txt just contains the machine names. You'd need to be on a domain and have admin rights on the machines though. Then invoke this from task scheduler on a machine still running at 10pm using your credentials
You could accomplish the same in PowerShell via piping Get-ADComputer [some filter string here to find your machines] | invoke-Command { shutdown /s}
These both assume you are on a domain.
tobyd
- 481