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.

Creating Groups with PowerShell/Orion SDK

Hey gang,

So I've been looking at the Group creation with PowerShell and the Orion SDK (https://github.com/solarwinds/OrionSDK/blob/master/Samples/PowerShell/Groups.ps1) for a bit now, and I think I need a second opinion.

I want to create these groups based on custom properties I have, and have them tiered as such. So the list of custom properties I have are Region, City, Campus, and FunctionName.

So what I want the script to do, ultimately, is create a hierarchy that is something like this:

Region
   - City
       - City - Campus
           - City - Campus - FunctionName
                - Nodes

So this would be something like:

NAM
    - USA Dayton OH
         - USA Dayton OH - 1st Street
              - USA Dayton OH - 1st Street - Active Directory
                   - DAY-DC01
              - USA Dayton OH - 1st Street - Switches
                   - DAY-SW01

All the custom properties are filled in, but what I can't seem to wrap my head around is how to iterate through the custom properties to form the subgroups properly. I know I will need to concatenate City and Campus, and then City, Campus, and FunctionName. I'm just struggling with where that logic comes into play.

I don't need someone to write it for me, but if you have done a group creation by city and/or other custom properties, can you share that? I need to see the code to really understand it, and the searches on thwack thus far don't really seem to have the lines I'm looking for.

Thanks,
Bryan