Hybrid shutdown state for a remote computer

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of random commandline random commandline 10 months, 3 weeks ago.

  • Author
    Posts
  • #34083
    Profile photo of StackExchangeUser7
    StackExchangeUser7
    Participant

    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.

    Thank you!

  • #34086
    Profile photo of random commandline
    random commandline
    Participant

    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
    

You must be logged in to reply to this topic.