Freigeben über


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'

 

GetContainingGroups.zip

Comments

  • Anonymous
    October 25, 2007
    PingBack from http://www.soundpages.net/computers/?p=5006
  • Anonymous
    October 27, 2007
    Boris Yanushpolsky has written a nice PS script to know what groups a server is member of. Nice work
  • Anonymous
    November 08, 2007
    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 lcation is not set."At C:testGetContainingGroups.ps1:5 char:40$containmentRel = Get-RelationshipClass  <<<< -name:'Microsoft.SystemCenter.IntanceGroupContainsEntities'Get-MonitoringClass : The 'Path' parameter is empty or the required provider loction is not set."At C:testGetContainingGroups.ps1:7 char:37$computerClass = Get-MonitoringClass  <<<< -name:"Microsoft.Windows.Computer"Get-MonitoringObject : Cannot bind argument to parameter 'MonitoringClass' becaue it is null.At C:testGetContainingGroups.ps1:11 char:51$computer = Get-MonitoringObject -monitoringClass:$ <<<< computerClass -critera:$criteriaYou cannot call a method on a null-valued expression.At C:testGetContainingGroups.ps1:13 char:72$relatedObjects = $computer.GetMonitoringRelationshipObjectsWhereTarget( <<<<containmentRel,[Microsoft.EnterpriseManagement.Configuration.DerivedClassTraverslDepth]::Recursive,[Microsoft.EnterpriseManagement.Common.TraversalDepth]::Recurive)
  • Anonymous
    June 24, 2008
    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:"
  • Anonymous
    July 12, 2008
    Check out Boris Yanushpolsky&#39;s blog ( http://blogs.msdn.com/boris_yanushpolsky ). Boris is an SCOM
  • Anonymous
    October 02, 2008
    Main Downloads page (catalog, documentation) http://technet.microsoft.com/en-us/opsmgr/bb498232.aspx
  • Anonymous
    February 26, 2009
    &#160; Voici une liste de liens trés pratique sur tous les sujets SCOM , installation , configuration...