Managing groups through Powershell
I'm wanting to programmatically create OM Groups that are reflective of computers that are within a given "support" class. In other words groups for "Production", "Test", "Development", "Hosted", etc. computers.
The intention is to use the groups to create alert/performance/etc. view limiting the scope to computers within these groups.
I'm wanting to base the group memberships using our VMWare Cluster structure, so I'm leveraging Powershell with the OM cmdlets and PowerCLI (VMWare) cmdlets to generate my grouping of monitored objects. So far so good.
Problem now is that I thought I had run across an OM cmdlet for managing group memberships...well...must have remembered incorrectly because I'm no longer able to locate such.
Now that I've collected the list of monitored objects for the groups, is there a reasonable method for managing the groups and their membership via Powershell?
I've seen some articles on leveraging the management pack interface in conjunction with using XML and InsertCustomMonitoringObjectGroup...but this seems like a cumbersome way to go. Any alternatives?
Alternatively, I'm willing to use Powershell to manage ADS groups, if I could somehow leverage those to create our views...but again, not seeing anything there either...
Thanks.-- Gerry O'Brennan (Missouri Univ of Science and Tech)
November 11th, 2010 11:53am
#2 Automate your group creation with Powershell http://www.systemcentercentral.com/BlogDetails/tabid/143/IndexID/60930/Default.aspx
and a forums post on this topic http://www.systemcentercentral.com/Forums/tabid/60/categoryid/5/indexid/57501/Default.aspx
check out the master collection of powershell scripts on SystemCenterCentral.com http://www.systemcentercentral.com/BlogDetails/tabid/143/IndexID/60930/Default.aspx
might also want to check out the System Center Operations Manager - Extensibility forum. http://social.technet.microsoft.com/Forums/en-US/operationsmanagerextensibility/threads
hope this helps!Scott Moss MVP (Operations Manager) | President - System Center Virtual Users Group | Vice President - Atlanta Southeast Management Users Group (ATL SMUG) Please remember to click Mark as Answer on the post that helps you!
Free Windows Admin Tool Kit Click here and download it now
November 11th, 2010 12:21pm
...I'm leveraging Powershell with the OM cmdlets and PowerCLI (VMWare) cmdlets to generate my grouping of monitored objects.
Using these tools, you can insert this data into whatever you want...Excel, text file, another database, etc...
Then create your custom group MP, and leverage the data source you've created to dynamically manage your groups.HTH, Jonathan Almquist - MSFT
November 11th, 2010 9:44pm
It's clear that managing group memberships through scripts is really just a hack into changing management pack entries and it's cumbersome at best. Given such, I'm looking at attacking this from a different angle.
Keep in mind that I already have a script that has classified the monitored objects according to the groups I want those monitored objects within.
My thought was that if I could simply populate the monitored objects with additional attributes and value (i.e. ESXHOST, Virtual Machine (boolean), MaintClass), then I might be able to use the group's "Dynamic membership" to populate the
group using those custom attributes as criteria.
The documentation for Discovery Data/Scripts led me down the path of authoring a management pack where I just set the Service Model Class and simply import that MP into OM. Steps done so far:
- Run Authoring Console:
- Create a New Management Pack
- Name: MST_ComputerAttributes
- Friendly Name: "MST - Computer Attributes"
- Description: "Added Computer Attributes for MST Maintenance"
- Select Classes, "New Custom Class"
- Class UID: "MST_ComputerAttributes.Custom"
- General:
- Base Class (List): "Microsoft.Windows.Server.Computer"
- Name: "MST Custom Computer Attributes"
- Desc: "Adding MST custom attributes to computer"
- Unchecked: Abstract, Hosted, Singleton
- Accessibility: Value=public
- properties:
- Right-click in left pane and select "Add Property"
- Properties:
- MST_VMWare, boolean, length 1
- MST_ESXHost, string, length 50
- MST_MaintType, string, length 20
- Import newly created management pack.
I'm seeing the attributes listed under MP Objects.
Now I'm needing to simply populate those attributes for all of the monitored objects. How do I go about doing so? Keep in mind, I don't plan to run a discovery process on all the computers because I already have a standalone script that has determined the
attribute values for each monitored object (I'll simply add the script to a scheduled task on a utility server to make changes to the attributes of the monitored objects...assuming this is possible).
Am I on the right track here?
One other thing, I've imported the management pack, but I'm not seeing a way to select the attribute when building the dynamic group membership (because the class isn't listed, nor is that attribute listed when selecting the parent class) .
Any help would be appreciated.
-- Gerry O'Brennan (Missouri Univ of Science and Tech)
Free Windows Admin Tool Kit Click here and download it now
November 15th, 2010 3:17pm
Not sure how it's going to work with your given scenario. It sounds complicated. You're on your way to something that sounds really cool, but my advice is to consider reworking the design and author the discoveries in
a more "traditional" way. (but my advice may be based on a lack of understanding and knowledge:)
For some ideas, take a look at this post Kevin Holman did a while back:
http://blogs.technet.com/b/kevinholman/archive/2009/01/27/populating-groups-from-a-sql-server-cmdb-step-by-step.aspx
This concept could be massaged into something that could work in just about any scenario. In Kevin's example, the data source is a SQL DB. But the data source can be just about anything. This could also be authored to be a little more dynamic
than what is described in his post with a bit of imagination (and it sounds like you've got plenty of that).HTH, Jonathan Almquist - MSFT
November 17th, 2010 2:44am