QuickTricks: One line PowerShell to remove all objects from maintenance mode

Are you looking for quick ways to see what is in maintenance mode and get them back out of maintenance mode? This blog post goes through the following:

What is currently in maintenance mode?

Removing all objects from maintenance mode

What is currently in maintenance mode?

To see what is currently in maintenance mode the following two approaches are available. The first option is not as usable from an output perspective but works well when removing items from maintenance mode. The second shown below provides a more readable format.

The graphic below shows how the PowerShell script runs when removing all items from maintenance mode and the results of re-checking what is in maintenance mode using the Get-SCOMMaintenanceMode command (no results indicating that there are no longer any objects which are in maintenance mode in this management group).