This is ours via GPP - %systemroot%\System32\Shutdown.exe -f -s -t 60, scheduled to run at 9PM as we have various after school clubs and staff doing work. (for some reason leaving the PCs on all night ...). I didnt think you could add a message to the shutdown? I thought a message was displayed informing the user that the PC was being shutdown, with a countdown timer?
I do an automated daily shutdown this way and it works very well.
New-PSDrive -PSProvider ActiveDirectory -Server "Name of your DC HERE" -Root "Name of your AD Root HERE" -Name Name of the drive -FormatType Canonical
cd Name of the drive:
cd "where your computers live:"
Get-ADComputer -Filter * | FT DNSHostName #this is just a simple way of getting all the computer names, you can make this filter find whatever you like. you don't need this line as we pipe the results into a var below.
$computer = Get-ADComputer -Filter * | FT DNSHostName #put the list of AD computers in a variable
Stop-Computer -ComputerName $computer -Force #put the throttlelimit in here if you are shutting down a lot of computers, you can also use the asjob and then get the results back use get-help stop-computer -examples
I take it the action for this should be create.
Doesn't seem to work for me on Win7.
Looks right to me. GPO is Computer Configuration
@mikkydoos I use the local system account not an AD account. It'll only need access to local resources anyway. When using GPP just don't use the "Run as" section. I also do not specify a "start in" directory.
EDIT: I use replace with an apply once only ILT