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"

$vCenterUseicoo手机rPassword = Read-Host -assecurestrinicon车型g "Enter Password"

$vCenterUserPassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($icon车型vCenterUserPassword))

Connect-viserver ${vCenterIP} -user ${vCenteicouldrUser} -password $vCent其他和其它的区别erUserPasswordimportant翻译 -WarningAction 0 | out-null

##Import VM list which need to change SCS其他货币资金I controller Scsi Bus sharing mode

$vmlist = Import-CSV "C:\Temp\vmlist.csv"

foreach ($vm in $vmlist){

##Assign Variables

$vmhost = $vm.importantnamicoo手机e

##Re-set VM's SCSI Controller 1 to Virtual

Get-Scsi系统运维工作内容Controllicoulder -vm $vmhost | where {$_.BusSharingMode -eq "physical"} | Set-ScsiController -BusSharingMode Virtual

##Get-ScsiControicoller -v其他综合收益m $vmhost | whe#importre {$_.Name -eq "SCSI Controller 1"} | Set-Scsicon车型iController -BusSharingMode Virtual

}

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