This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Database table in Orion to place about 500 servers into Maintenance

Hi, I would like to know the database table name in which we can directly run query to read list of machine names from text file  that i wanted to put them in to maintenance. Currently i keep struggling to put about 300-400 machines manually every day to select and place them into maintenance using Orion console, which is very very painfull job for me. I need some script or backened process which will read the list of machines from a text and place them into Maintenance window. Please help  me out.

Thanks in advance.

Ravi

  • Here's a trivial powershell script that will do this.

    gc .\servers.txt |% {

        $nodeId = get-swisdata $swis "SELECT NodeID FROM Orion.Nodes WHERE Caption=@c" @{c=$_.Trim()}

        Invoke-SwisVerb $swis Orion.Nodes Unmanage @("N:$nodeId", [DateTime]::UtcNow, [DateTime]::UtcNow.AddDays(1), $false)

    }

    It assumes that each line servers.txt matches a Caption in the nodes table. It uses a query to look up the NodeID for that server, then unmanages the node for one day.

    You may want to add additional error checking and validation.