VMware Cloud Community
RobMokkink
Expert
Expert
Jump to solution

ExitMaintenanceMode_Task

I have a question how to invoke ExitMaintenanceMode_Task.

I want to be able to get a server out of maintence mode.

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You could do it like this

$esx = Get-VMHost <ESX-hostname> | Get-View

$taskMoRef = $esx.ExitMaintenanceMode_Task(0)

$task = Get-View $taskMoRef 
while ($task.Info.State -eq "running" -or $task.Info.State -eq "queued") {
  sleep 2
  $task = Get-View $taskMoRef
}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

You could do it like this

$esx = Get-VMHost <ESX-hostname> | Get-View

$taskMoRef = $esx.ExitMaintenanceMode_Task(0)

$task = Get-View $taskMoRef 
while ($task.Info.State -eq "running" -or $task.Info.State -eq "queued") {
  sleep 2
  $task = Get-View $taskMoRef
}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
RobMokkink
Expert
Expert
Jump to solution

Thanks Luc,

I overlooked (0)

I need a holiday

0 Kudos