#Rescan all HBA's creating 1 job for each ESX server
# Kyle Weir, jkw117@gmail.com, 10-05-09
#connects initially to get the list of ESX servers
Connect-VIServer "vcenter" -User Administrator -Password password
vm=get-vmhost
#Passes the server names individually to different jobs. Thus allowing it to ask each ESX host to rescan itself.
for ($x=0 ; $x -le $vm.length; $x++)
{
Start-Job -ArgumentList $vm[$x|http://communities.vmware.com/community-document-picker.jspa?communityID=3077&subject=%24x].name -ScriptBlock {
Add-PSSnapin VMware.VimAutomation.Core
Connect-VIServer "vcenter" -User Administrator -Password $pasd
get-vmhost $args| Get-VMHostStorage -RescanAllHBA -rescanVMFS -refresh
}
}
Comments |
|
There are no comments on this document |