[オリジナル] PowerCli スクリプトを使用して vCenter で仮想マシンを起動する

1.ESXIホストに接続します

$ServerIP="192.168.251.54"
$Username="root"
$Password="MyPassword"
$Server=Connect-VIServer -Server $ServerIP -Protocol https -User $Username -Password $Password

2 仮想マシンを非同期で起動します

次のスクリプトを実行します

VMware.VimAutomation.Core\Start-VM -RunAsync -Server 192.168.251.54 -VM  012_CentOS8_DHCP
VMware.VimAutomation.Core\Start-VM -RunAsync -Server 192.168.251.54 -VM  013_W2022_信息发布系统
VMware.VimAutomation.Core\Start-VM -RunAsync -Server 192.168.251.54 -VM  078_W10_金忱
VMware.VimAutomation.Core\Start-VM -RunAsync -Server 192.168.251.54 -VM  079_W10_宜宾远程办公

3 仮想マシンでAPPを起動します

良い方法はありません。
https://docs.vmware.com/cn/VMware-Tools/12.2.0/com.vmware.vsphere.vmwaretools.doc/GUID-615CAD19-C769-4774-A161-3F2E97344E68.html

4 接続を閉じる

Disconnect-VIServer -Server * -Force

おすすめ

転載: blog.csdn.net/u013667796/article/details/132283640