Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $vcHost = "virtual.center.host"
- $vcClusterName = "Your ClusterName"
- $vcUser = "username"
- $vcPass = "password"
- $vcServer = Connect-VIServer -Server:$vcHost -User:$vcUser -Password:$vcPass -WarningAction:SilentlyContinue
- $vmHosts = Get-Datacenter | Get-Cluster -Name:$vcClusterName | Get-VMHost | Sort
- ForEach ($vmHost in $vmHosts) {
- If (Get-VMHostStorage -VMHost:$vmHost -Refresh -ErrorAction:SilentlyContinue -WarningAction:SilentlyContinue) {
- Write-Host $vmHost.Name," host storage information refreshed"
- } else {
- Write-Host $vmHost.Name," host storage refresh failed!"
- }
- }
- Disconnect-VIServer -Server:$vcServer -Confirm:$false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement