Advanced Windows PowerShell Scripting Video Training

Advanced Windows PowerShell Scripting Video Training
Advanced Windows PowerShell Scripting Video Training

Thursday, April 14, 2011

How to force a client to reboot with PowerShell

OK, the actual question from class was how to force a client to reboot while someone is logged in.  Be careful with this one.  This will not give the user at the other end the opportunity to save anything.

Restart-Computer –ComputerName ComputerName –Force

Don’t sweat, standard user accounts cannot shutdown a domain controller.  If you check the user rights on a domain controller, only the members of the Administrators, Backup Operators, Print Operators, and Server Operators groups can do this.  Everyone else gets this:
Restart-Computer : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

No comments: