$vmhost_list = Import-Csv .Desktophlw_vmhost_user_list.csv
foreach ($vmhost in $vmhost_list){
Connect-VIServer $vmhost.esxi_ip -user $vmhost.esxi_user -Password $vmhost.esxi_passwd
New-VMHostAccount -Id $vmhost.oss_user -Password $vmhost.oss_passwd -UserAccount
New-VIPermission -Entity $vmhost.esxi_ip -Principal ossuser -Role ReadOnly -Propagate:$true
}
esix主机登录信息表