Hello,
I am looking for a way to put some Service monitoring (created via the authoring templates) in maintenance mode using a powershell script.
I already use the following script to put a group of computers in maintenance mode via powershell. After many tries I can't manage adapting it to work with Service monitoring)
Thanks in advance !
Edit:
I found the answer, objects and classes to be used are the following:
# Get class/objects
$objectClass = get-monitoringclass | where {$_.DisplayName -eq $NameOfYourServiceOrProcessMonitor}
$objects = get-monitoringobject -monitoringclass:$objectClass | where {$_.PathName -match $FQDN_hex}
with $FQDN_hex a variable containing the FQDN of the server you want to put the service/process in maintenance mode, special chars converted into hexa is there are ones in your naming convention..