# unable to restart VM from host

**URL:** <https://forums.powershell.org/t/unable-to-restart-vm-from-host/4610>\
**Category:** PowerShell Help\
**Created:** [August 1, 2015, 4:09pm UTC](https://forums.powershell.org/t/unable-to-restart-vm-from-host/4610 "2015-08-01T16:09:21Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![soma-sympli](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@soma-sympli](https://forums.powershell.org/u/soma-sympli)\
**Post date:** [August 1, 2015, 4:09pm UTC](https://forums.powershell.org/t/unable-to-restart-vm-from-host/4610/1 "2015-08-01T16:09:21Z")

</div>

Hi there, im unable to restart my VM (WIN7 32 BIT) from my host (win8 63 bit) I get error "PS C:&gt; 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

---

<div class="post-metadata">

**Author:** ![vasken-h](https://avatars.discourse-cdn.com/v4/letter/v/cdc98d/32.png) [@vasken-h](https://forums.powershell.org/u/vasken-h)\
**Post date:** [August 1, 2015, 4:18pm UTC](https://forums.powershell.org/t/unable-to-restart-vm-from-host/4610/2 "2015-08-01T16:18:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![soma-sympli](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@soma-sympli](https://forums.powershell.org/u/soma-sympli)\
**Post date:** [August 1, 2015, 4:21pm UTC](https://forums.powershell.org/t/unable-to-restart-vm-from-host/4610/3 "2015-08-01T16:21:15Z")

</div>

PowerShell prompt as Administrator

---

<div class="post-metadata">

**Author:** ![vasken-h](https://avatars.discourse-cdn.com/v4/letter/v/cdc98d/32.png) [@vasken-h](https://forums.powershell.org/u/vasken-h)\
**Post date:** [August 1, 2015, 4:25pm UTC](https://forums.powershell.org/t/unable-to-restart-vm-from-host/4610/4 "2015-08-01T16:25:21Z")

</div>

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

Restart-Computer -Computer win7 -Credential Domain\Username

---

<div class="post-metadata">

**Author:** ![soma-sympli](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@soma-sympli](https://forums.powershell.org/u/soma-sympli)\
**Post date:** [August 1, 2015, 4:25pm UTC](https://forums.powershell.org/t/unable-to-restart-vm-from-host/4610/5 "2015-08-01T16:25:52Z")

</div>

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 &lt;&lt;&lt;

```

---

<div class="post-metadata">

**Author:** ![soma-sympli](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@soma-sympli](https://forums.powershell.org/u/soma-sympli)\
**Post date:** [August 1, 2015, 4:27pm UTC](https://forums.powershell.org/t/unable-to-restart-vm-from-host/4610/6 "2015-08-01T16:27:13Z")

</div>

yes tried with the credential param, still doesnt work ☹

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [August 1, 2015, 10:52pm UTC](https://forums.powershell.org/t/unable-to-restart-vm-from-host/4610/7 "2015-08-01T22:52:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![soma-sympli](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@soma-sympli](https://forums.powershell.org/u/soma-sympli)\
**Post date:** [August 2, 2015, 12:04am UTC](https://forums.powershell.org/t/unable-to-restart-vm-from-host/4610/8 "2015-08-02T00:04:45Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![pscookiemonster](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/pscookiemonster/32/634_2.png) [@pscookiemonster](https://forums.powershell.org/u/pscookiemonster)\
**Post date:** [August 2, 2015, 12:06am UTC](https://forums.powershell.org/t/unable-to-restart-vm-from-host/4610/9 "2015-08-02T00:06:09Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![soma-sympli](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@soma-sympli](https://forums.powershell.org/u/soma-sympli)\
**Post date:** [August 5, 2015, 5:58pm UTC](https://forums.powershell.org/t/unable-to-restart-vm-from-host/4610/10 "2015-08-05T17:58:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:45pm UTC](https://forums.powershell.org/t/unable-to-restart-vm-from-host/4610/11 "2024-05-16T20:45:15Z")

</div>

Closed on May 16, 2024, 8:45pm UTC


