#2 Automate your group creation with Powershell
By KRAndersen on 3/17/2010 8:32:42 AM • Rank (3094) • Views 3240
0

0

One of our very good customers are managing servers with an dedicated internal administrator as a primary contact for each server. They are managing this one to one relation with an Excel sheet.

A while ago we talked about automating this group creation with powershell, so the last time Jacob and I was discussing Powershell in Operations Manager we found a solution – Jacob who is the best Danish Powershell Guru of cause did a superoptimization of my first script and now its up to you to test it on your own.

Download

"Only registered users may download. Registration is free."

Version: 1.0.2
Importance: Optional
Guide:
Latest Media - View All Media (1)
   
Comments (4) - Comment RSS
Andreas Zuckerhut wrote: on Mar 17, 2010 09:40 AM
I like a few parts of the code but the documentation is pretty useless unless you can read Powershell. Also, using runtimearguments beats static vars by far ;)

Also, you should have mentioned that Col2 is the Groupname.
ARentsch wrote: on Dec 29, 2010 11:18 AM
Very good idea – I tried it but there are some little errors in the script. I will share it with you:



1) Check Language Settings if Excel Workbook errors occurs



2) The scripts finds no agents with this line “cd (“Monitoring:\” + (get-rootmanagementserver).Principalname)”, but with this line ”

cd (“Monitoring:\” + (get-rootmanagementserver).Principalname + “\Microsoft.SystemCenter.AgentManagedComputerGroup”)”



unfortunatly I got another error while creating the groups:



Exception calling “InsertCustomMonitoringObjectGroup” with “1″ argument(s): “Processing the template failed. See inner exception for details.”

At C:\temp\GroupsFromExcelSheet.ps1:166 char:40

+ $mp.InsertCustomMonitoringObjectGroup <<<< ($group)

+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException

+ FullyQualifiedErrorId : DotNetMethodException



Any idea on this?



Regards

Andy
shadowman wrote: on Sep 24, 2011 03:23 PM
Some more documentation about how this script works would be very useful, also the Excel sheet.
mattyt0406 wrote: on Jan 30, 2012 04:05 PM
Has there been any resolution to the : Exception calling “InsertCustomMonitoringObjectGroup” with “1″ argument(s): “Processing the template failed. See inner exception for details.”
error?
I need this to work and I have tried any\everything i can think ok!

PLEASE HELP!!!!!
Add your Comment


Who Viewed
Who Reviewed
Categories
Tags
Create Groups with Powershell
Related Pages
Shortened URL
http://tinyurl.com/yce4sjt

Top Contributors
Featured Members
Pete Zerger
Points: 65622
Level: System Center Expert
Tommy Gunn
Points: 42748
Level: System Center Expert
Simon Skinner
Points: 40804
Level: System Center Expert
Stefan Koell
Points: 28999
Level: System Center Expert
Andreas Zuckerhut
Points: 27734
Level: System Center Expert