4 Replies Latest reply on Jun 20, 2017 12:50 PM by tdanner

    PowerShell Add Node to Group

    cstewart28

      Having issues with adding several nodes from a CSV file to an existing group. I need to clean out the group of all existing nodes (have not figured this part out as of yet) and then add the nodes from the csv file.  I'm getting an "Invalid definition error".  Not sure where the issue is. 

       

      See attached for script.

        • Re: PowerShell Add Node to Group
          tdanner

          The problem is that "/Orion/NetPerfMon/NodeDetails.aspx?NetObject=N:$NodeID" is not a SWIS Uri. That's a relative web address. A SWIS Uri looks like this: "swis://server/Orion/Orion.Nodes/NodeID=123". You can get the correct uri for a node like this:

           

          $NodeUri = Get-SwisData $swis "SELECT Uri FROM Orion.Nodes WHERE IPAddress = '$IP'"
          
          

           

          PS - this is a cool trick!

           

          sort-object @{Expression={[version]$_.EthernetIPAddress};}
          
          2 of 2 people found this helpful