“Privilege not held” error with PowerShell “Stop-Computer” cmdlet

Since April 2017 security updates, you may get the following error when you use the Stop-Computer cmdlet:

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

As described by Microsoft in the following KB,  it is an issue caused by the April 2017 security updates and affects PowerShell 3.0 and later.

This error has not yet been fixed. So you must use the Shutdown command as a workaround:

PS > shutdown.exe -r
or
PS > shutdown.exe -t

You also can still use the Stop-Computer cmdlet by adding the -AsJob parameter:

PS > Stop-Computer -AsJob

 

Thanks for reading! You can follow me on Twitter @PrigentNico

About Nicolas 282 Articles
I work as an IT Production Manager, based in Paris (France) with a primary focus on Microsoft technologies. I have 10 years experience in administering Windows Servers. . I am a Microsoft MVP for Cloud & Datacenter Management. I also received the PowerShell Hero 2016 award by PowerShell.0rg. And finally, I am "MCSE: Cloud Platform and Infrastructure", "MCSA: Windows Servers", "Administering & Deploying SCCM", and CheckPoint CCSA certified.