Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 224018

Re: Resetting HardwareStatus via PowerCLI

$
0
0

Hi,

 

would this work?

 

$usr = "root"

$pass = "secretpassword"

 

 

 

$hosts = Get-View -ViewType Hostsystem | Sort Name | Select -Expandproperty Name

 

 

 

foreach ( $singlehost in $hosts ) {

 

 

 

Write "Processing" $singlehost"...."

 

 

 

connect-viserver $singlehost -User $usr -Password $pass |(Get-View (Get-VMHost $_ | Get-View).ConfigManager.HealthStatusSystem).ResetSystemHealthInfo()

connect-viserver $singlehost -User $usr -Password $pass |(Get-View (Get-VMHost $_| Get-View).ConfigManager.HealthStatusSystem).UpdateViewData()

connect-viserver $singlehost -User $usr -Password $pass |(Get-View (Get-VMHost $_ | Get-View).ConfigManager.HealthStatusSystem).RefreshHealthStatusSystem()

 

Disconnect-VIServer -Server $singlehost

 

Write "next Host..."

 

}


Viewing all articles
Browse latest Browse all 224018

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>