powershell stop-computer cmdlet suddenly stops to work, even in administrator shell:

PS C:\> Stop-Computer
Stop-Computer : Privilege not held.
At line:1 char:1
+ Stop-Computer
+ ~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (fluter-s:String) [Stop-Computer], ManagementException
+ FullyQualifiedErrorId : StopComputerException,Microsoft.PowerShell.Commands.StopComputerCommand

It used to work with non-administrator shell, because surely a normal user can shutdown the system. There isn't a system update either.

Version info:

PS C:\> echo $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14393.1066
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.1066
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3

This have to be the result of a bug in one of OS updates. See more: https://support.microsoft.com/en-us/help/4020459/after-you-apply-april-2017-security-updates-from-cve-2017-0160

From site:

To work around this issue, run the following “shutdown.exe” command to execute power-down and restart operations on local or remote systems:

shutdown.exe [-r] [-s] [-m \\computer]

For more information and command help, run:

shutdown.exe -?
| improve this answer | |
  • 1
    Would you be able to elaborate on your answer, probably by explaining the workaround in-depth, instead of just linking to it? – Caturday Saint May 1 '17 at 18:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.