Welcome › Forums › General PowerShell Q&A › Hybrid shutdown state for a remote computer
This topic contains 1 reply, has 2 voices, and was last updated by
Could you tell me please how to make hybrid shutdown state (S4) for a remote computer (Windows 8.1) using PowerShell?
There is the cmd command
shutdown.exe /s /hybrid /m \\compname
but it puts the remote computer into S5 (off state) instead of expected S4 (hybrid shutdown state).
There is PowerState Enumeration (https://msdn.microsoft.com/ru-ru/library/system.windows.forms.powerstate%28v=vs.110%29.aspx?cs-save-lang=1&cs-lang=csharp&f=255&MSPPError=-2147217396#code-snippet-1) but it refers to only two states: hibernate and suspend. But hibernation is not what I need. I need hybrid shutdown that combines hibernation and shutting down.
I am not sure what the Stop-Computer equivalent would be, but you can control 'shutdown.exe' via Start-Process cmdlet. Hope this helps.
Start-Process -FilePath shutdown.exe -ArgumentList “/s /hybrid /m /compname /t 10”
If the WS-Management service is running, you can run the command via a remote session.
Enter-PSSession -ComputerName compname
[compname]: PS C:\> shutdown.exe /s /hybrid
The topic ‘Hybrid shutdown state for a remote computer’ is closed to new replies.