Set VM SCSI Controller Bus Sharing Mode

【Set VM SCSI Controller Bus Sharing Mode】少年意气强不羁,虎胁插翼白日飞。这篇文章主要讲述Set VM SCSI Controller Bus Sharing Mode相关的知识,希望能为你提供帮助。
?##Connect vCenter server?$vCenterIP = Read-Host "Enter the VC IP Address/Name "
$vCenterUser = Read-Host "Enter User name"
$vCenterUserPassword = Read-Host -assecurestring "Enter Password"
$vCenterUserPassword =[System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($vCenterUserPassword))
Connect-viserver $vCenterIP -user $vCenterUser -password $vCenterUserPassword -WarningAction 0 | out-null

##Import VM list which need to change SCSI controller Scsi Bus sharing mode$vmlist = Import-CSV "C:\\Temp\\vmlist.csv"

foreach ($vm in $vmlist)

##Assign Variables$vmhost = $vm.name
##Re-set VMs SCSI Controller 1 to VirtualGet-ScsiController -vm $vmhost | where $_.BusSharingMode -eq "physical" | Set-ScsiController -BusSharingMode Virtual
##Get-ScsiController -vm qcwin7 | where $_.Name -eq "SCSI Controller 1" | Set-ScsiController -BusSharingMode Virtual

Disconnect-viserver $vCenterIP -Confirm:$false #| out-null

    推荐阅读