Thanks, LucD.
The first one you linked to seems work well. Is there a way to have it call multiple ESXi servers and maybe prompt for credentials?
If I exclude the username and password and leave the variable references it will prompt and still works which is fine.
Here's what I've modified to get working;
#$cluster =
#$vcenter =
$user =
$password =
Connect-VIServer myESXiServer
Foreach($esxhost in (Get-VMHost -Location $cluster)){
Connect-VIServer $esxhost -User $user -Password $password
$hostView = get-vmhost -name $esxhost | get-view
$dsView = get-view $hostView.ConfigManager.DatastoreSystem
$unBound = $dsView.QueryUnresolvedVmfsVolumes()
foreach ($ub in $UnBound) {
$extPaths = @()
$Extents = $ub.Extent;
foreach ($ex in $Extents) {
$extPaths = $extPaths + $ex.DevicePath
}
$resolutionSpec = New-Object VMware.Vim.HostUnresolvedVmfsResolutionSpec[] (1)
$resolutionSpec[0] = New-Object VMware.Vim.HostUnresolvedVmfsResolutionSpec
$resolutionSpec[0].extentDevicePath = New-Object System.String[] (1)
$resolutionSpec[0].extentDevicePath[0] = $extPaths
$resolutionSpec[0].uuidResolution = "forceMount"
$dsView = Get-View -Id 'HostStorageSystem-storageSystem'
$dsView.ResolveMultipleUnresolvedVmfsVolumes($resolutionSpec)
}
}