locked
Service monitor in Maintenance mode using Powershell RRS feed

  • Question

  • 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..
    • Edited by Vgkda Friday, June 8, 2012 2:48 PM
    Wednesday, June 6, 2012 4:17 PM

Answers

  • Answer found

    See edit in first post

    Thanks

    • Marked as answer by Vgkda Friday, June 8, 2012 3:48 PM
    Friday, June 8, 2012 2:58 PM

All replies