unable to restart VM from host

This topic contains 9 replies, has 4 voices, and was last updated by Profile photo of Soma sympli Soma sympli 1 year, 7 months ago.

  • Author
    Posts
  • #28097
    Profile photo of Soma sympli
    Soma sympli
    Participant

    Hi there, im unable to restart my VM (WIN7 32 BIT) from my host (win8 63 bit) I get error "PS C:\> Restart-Computer win7
    Restart-Computer : Failed to restart the computer win7 with the following error message: Access is denied. (Exception
    from HRESULT: 0x80070005 (E_ACCESSDENIED)).
    At line:1 char:1
    + Restart-Computer win7

    I had PS remoting enabled on bothe machines,however it still doesnt work. Could you please help!

    Thank you

  • #28098
    Profile photo of Vasken
    Vasken
    Participant

    Are you running your PowerShell prompt or ISE instance as Administrator?

  • #28099
    Profile photo of Soma sympli
    Soma sympli
    Participant

    PowerShell prompt as Administrator

  • #28100
    Profile photo of Vasken
    Vasken
    Participant

    Have you tried issuing the command along with the Credential parameter, like so:

    Restart-Computer -Computer win7 -Credential Domain\Username

  • #28101
    Profile photo of Soma sympli
    Soma sympli
    Participant

    Also, does this mean psremoting is enabled?
    what does , WinRM already is set up to receive requests on this machine.
    Set-WSManQuickConfig : Access is denied.
    At line:50 char:33

    PS C:\Windows\system32> Enable-PSRemoting

    WinRM Quick Configuration
    Running command "Set-WSManQuickConfig" to enable this machine for remote management through WinRM service.
    This includes:
    1. Starting or restarting (if already started) the WinRM service
    2. Setting the WinRM service type to auto start
    3. Creating a listener to accept requests on any IP address
    4. Enabling firewall exception for WS-Management traffic (for http only).

    Do you want to continue?
    [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): a
    WinRM already is set up to receive requests on this machine.
    Set-WSManQuickConfig : Access is denied.
    At line:50 char:33
    + Set-WSManQuickConfig <<<

  • #28102
    Profile photo of Soma sympli
    Soma sympli
    Participant

    yes tried with the credential param, still doesnt work 🙁

  • #28106
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Note that Restart-Computer doesn't use WinRM. Are you able to use Shutdown.exe? If not, there's a permissions or connectivity problem.

  • #28109
    Profile photo of Soma sympli
    Soma sympli
    Participant

    wow! reply from don jones himself 🙂

    I'm unable to shutdown.exe either

    PS C:\Windows\system32> shutdown.exe /s /m \\win7
    win7: Access is denied.(5)

  • #28110
    Profile photo of Warren Frame
    Warren Frame
    Participant

    Your error output seems pretty clear, did you read it?

    To clarify the question: Are you on some computer, trying to restart another computer (that happens to be a VM)?

    Like Don mentioned, permissions or connectivity. Given that you're getting access denied, permissions seem likely...

    Ignore the fact that this is a VM. How do you restart another computer? You need privileges to do this. Same deal here, doesn't matter if the VM is on your computer.

    Unless your PowerShell session somehow has access to this remote computer (e.g. through domain privileges), you're not going to have access to restart it. If your hypervisor (Hyper-V?) supports it, you might be able to use a command like 'Restart-VM', that works around these privilege requirements by using an agent on the VM.

    Cheers!

  • #28219
    Profile photo of Soma sympli
    Soma sympli
    Participant

    true, that machine was out of domain, now I joined to domain and using get-cred it worked... thank you guys !!

You must be logged in to reply to this topic.