1 Reply Latest reply on Jan 17, 2013 1:22 PM by tdanner

    Database table in Orion to place about 500 servers into Maintenance

    rdevarupala

      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

        • Re: Database table in Orion to place about 500 servers into Maintenance
          tdanner

          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.