There are many different solutions out on the web for backing up unsealed management packs in Operations Manager. Most of these involved storing the backups on a share somewhere and usually still required manual intervention.
After using (and loving) the new Visual Studio Authoring Extensions I began to think about how I can get my unsealed MPs in TFS as well. This would then give me a one stop shop for all the management packs used in my environments. It would also give me an easy way to view the changes that were made.
The result of my daydreaming (and work!) is the below script.
This PowerShell script (although some might call it “C# in PS”) will sync any unsealed Management Packs to a folder in TFS. It works by exporting all unsealed MPs and then checking TFS for differences. It will do adds, edits, and deletes in TFS and check-in all pending changes.
This PowerShell script must be run on a server with the following installed:
Script is at the bottom of this post
First things first, you will have to configure the script with the details of your environment…
With that you should be good to go! The script does drop events which can be tracked. Down the road, Ill share a management pack for alerting on any issues.
Also, check back in the future for a post on the V2 version of this (Hint – This would make a nice custom Activity in an Orchestrator Integration Pack… )
Please provide any feedback on the script in the comments below. I'm always one to give credit to others for finding bugs or providing improvements.
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included utilities are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm