PowerShell for Windows Admins

Feb 25 2014   12:16PM GMT

Waiting for restart

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Some times you need to reboot a remote machine as part of your process.  PowerShell provides the Restart-Computer cmdlet to perform that task:

Restart-Computer -ComputerName server03

If you want you process to pause until the reboot has finished then you add the –Wait parameter:

Restart-Computer -ComputerName server03

You final options when pausing are to wait until a specific service – PowerShell, WinRM or WMI is avialable:

Restart-Computer -ComputerName server03 -Wait -For PowerShell

Restart-Computer -ComputerName server03 -Wait -For WinRM

Restart-Computer -ComputerName server03 -Wait -For Wmi

These options should cover most situations as these services are among the last to become available when a machine starts.

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: