$username = "root" $password = "mypassword" $ipstart = "192.168.1." $ipend = 23..25 $ipnew = 11 foreach ($iplist in $ipend) { $serverip = $ipstart + $iplist Connect-VIServer -Server $serverip -user $username -Password $password | Out-Null $kernelip = $ipstart + $ipnew New-VMHostNetworkAdapter -VirtualSwitch vSwitch0 -PortGroup "Mnagement Network" -IP $kernelip -SubnetMask 255.255.255.0 $ipnew = $ipnew + 1 Disconnect-VIServer -Server * -Confirm:$false }
Powercli 批量添加vmkernel网络
原创
©著作权归作者所有:来自51CTO博客作者bard_zhang的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章