Jump to content

Recommended Posts

Posted

Hi all,

 

Shutdown software that works on Windows 7 & 8 ?

 

Need to schedule, configure and deploy remotely from server 2012.

 

Any suggestions appreciated.

 

Cheers.

Posted
Use a scheduled task with GPP - it's free and fairly simple to setup. you just need to ensure that you specify the timing of the shutdown 20mins after the school should have been closed.
Posted
powershell stop-computer "%computername%" -Force will do it for you, you could write a task to run the script. You could also poll the computers on your network to see if they are on and pass the names to it and I suppose you could even check if it has any active sessions on it as well.
Posted (edited)

You don't need to spend any money on this.

 

Use the Shutdown command, it works in win7 and win8. You can write a command for each computer (shutdowm /s /m \\computername) in a text file. Save it as a .bat to make a batch file. You can then schedule the batch file as a regular scheduled task. I prefer to do this from the command line too using the "at" command. It saves using admin account credentials that you can forget to update the password for.

 

If you have a lot, copy the first part of the command in to a column in excel, copy the computer names (exported) in to the next column. Use the concatenate (&) function to make the completed commands in a third column. Cut and paste this to third column to notepad.

 

Edit: see Shutdown Command Details and Examples for what else you can do with the shutdown command. restart, x minute delay, force user log off etc.

Edited by GeekyPete
Posted (edited)

OK so a GPP it is. Now... when I run %systemroot%\system32\shutdown.exe -f -s -t 180 "This computer will automatically shutdown in 3 minutes. Please save your work now" from a cmd prompt on my machine it asks for a reason code in the argument.

 

Never got my head around this. Its to do with the "MSG in quotes"

 

Can someone send me an example ?

Edited by mikkydoos
Posted (edited)

It should be: %systemroot%\system32\shutdown.exe -s -f -t 180 -c "This computer will automatically shutdown in 3 minutes. Please save your work now"

 

I would also give them a bit longer warning time - 1800 (30 minutes) is what trial and error have told me to be a reasonable compromise.

 

I you are running this on a server, then you will need a reason code - you don't on clients.

Edited by Mr.Ben
Bad Math!
  • Thanks 1
Posted
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?
  • Thanks 1
Posted

Import-Module ActiveDirectory

 

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

Posted (edited)

I take it the action for this should be create.

 

Doesn't seem to work for me on Win7.

 

1.jpg

 

2.jpg

 

3.jpg

 

4.jpg

 

Looks right to me. GPO is Computer Configuration

Edited by mikkydoos
Posted (edited)

@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

Edited by chazzy2501
  • 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...