简体   繁体   中英

Shutting down VM's remotely in PowerShell 2.0?

I'm currently having difficulties shutting down virtual machines remotely that are hosted on a Windows Server 2008 (also a 2003) machine. My first problem is anytime I run the inital Get-VM command I receive the following error: "The term 'Get-VM' is not recognized as the name of a cmdlet". All I find online are solutions to this for Server 2012 and those haven't worked for me either. I'm pretty sure once I resolve this problem I will be able to take steps in the right direction to issuing the commands to shutdown the VMs and the server itself. Thank you for taking time to read this, and have a great day.

VMWare Workstation doesn't provide a Powershell interface. If the guests have network access with the host, you can use shutdown.exe to, well, shut down the guests

VMWare has got an API called VIX , which provides a COM interface. There are examples for VBScript, C and C#, so a Powershell binding should be easy enough. I don't have got a VMWare box, so can't test it. Anyway, some success is reported around the web. Like so , and so .

I figured out the easiest way to do this is to download PowerCLI 4.0 and the cmdlets that are installed allow you to remote into servers with the command Connect-VI Server -Server 127.0.0.1 and shut them down with the command Stop-VM . If anyone is reading this whom is trying to resolve something similar, make sure it's version 4.0 of PowerCLI and not anything else.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM