Welcome to MSDN Blogs Sign in | Join | Help

Which groups is a particular computer member of?

Given that groups are used for role based security, overrides, reports, and some other features, it might be pretty interesting to know what groups is a particular computer member of. Attached is a sample script that dumps the list of groups that a particular computer is a member of.

Steps to run the script:

1 - Save the script file

2 - Open the OpsMgr command shell

3 - Run the following: C:\GetContainingGroups.ps1 -computerFQDN:'server1.contoso.com'

 

Published Friday, October 26, 2007 5:17 AM by Boris Yanushpolsky
Filed under:

Attachment(s): GetContainingGroups.zip

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Computers » Which groups is a particular computer member of?

# Which groups is a server member of ?

Sunday, October 28, 2007 5:46 AM by System Center User Group Belgium

Boris Yanushpolsky has written a nice PS script to know what groups a server is member of. Nice work

# re: Which groups is a particular computer member of?

Thursday, November 08, 2007 12:34 PM by geist_23@hotmail.com

This script fails and complains that any server name I enter does not have a path. And in truth when I look at Computers under monitoring they indeed do not have a path.

Get-RelationshipClass : The 'Path' parameter is empty or the required provider l

cation is not set."

At C:\test\GetContainingGroups.ps1:5 char:40

+ $containmentRel = Get-RelationshipClass  <<<< -name:'Microsoft.SystemCenter.In

tanceGroupContainsEntities'

Get-MonitoringClass : The 'Path' parameter is empty or the required provider loc

tion is not set."

At C:\test\GetContainingGroups.ps1:7 char:37

+ $computerClass = Get-MonitoringClass  <<<< -name:"Microsoft.Windows.Computer"

Get-MonitoringObject : Cannot bind argument to parameter 'MonitoringClass' becau

e it is null.

At C:\test\GetContainingGroups.ps1:11 char:51

+ $computer = Get-MonitoringObject -monitoringClass:$ <<<< computerClass -criter

a:$criteria

You cannot call a method on a null-valued expression.

At C:\test\GetContainingGroups.ps1:13 char:72

+ $relatedObjects = $computer.GetMonitoringRelationshipObjectsWhereTarget( <<<<

containmentRel,[Microsoft.EnterpriseManagement.Configuration.DerivedClassTravers

lDepth]::Recursive,[Microsoft.EnterpriseManagement.Common.TraversalDepth]::Recur

ive)

# re: Which groups is a particular computer member of?

Tuesday, June 24, 2008 10:55 AM by Boris Yanushpolsky

The reason the script is failing is that you ar switching to the FileSystem provider from the OpsMgr provider. There is no need to navigate to C:\. All you need to do is just put in the full path to the PS1 file. In other words, dont do "CD C:\"

# A Great place for SCOM scripts

Sunday, July 13, 2008 7:12 AM by Dario IT Solutions Blog

Check out Boris Yanushpolsky&#39;s blog ( http://blogs.msdn.com/boris_yanushpolsky ). Boris is an SCOM

# SCOM 2007 Useful Links

Thursday, October 02, 2008 1:56 PM by Dario IT Solutions Blog

Main Downloads page (catalog, documentation) http://technet.microsoft.com/en-us/opsmgr/bb498232.aspx

# Les meilleurs liens OPSMGR 2007

&#160; Voici une liste de liens trés pratique sur tous les sujets SCOM , installation , configuration...

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker