none
How to gather Server's overrides and groups details into scom 2016.

    Pregunta

  • Hi All,

    I want to gather the below information. like 

    - Server is part of which group, (means it was a part of how many groups).

    - How many overrides was applied on Server. 

    Note - If You all want to add any other point (As above) so we can add here to get the all records of node.

    miércoles, 13 de junio de 2018 14:58

Respuestas

  • >>Server is part of which group, (means it was a part of how many groups).
    Consider using the following sql statement
    select SourceObjectDisplayName  group_name from RelationshipGenericView where TargetObjectDisplayName like '%hkXXXmon01%'
    where hkXXXmon01 is the server name.
    Roger

    jueves, 14 de junio de 2018 3:51
  • Hi,

    Please see if this script works for you:

    ## FQDN
        $computerFQDN = "computerFQDN"
    ## Get Windows Computer class
        $computerClass = Get-SCOMClass -Name "Microsoft.Windows.Computer"
    
    ## Get SCOM object # MonitoringObject (Microsoft.EnterpriseManagement.Monitoring.PartialMonitoringObject)
        $computer = Get-SCOMClassInstance -Class $computerClass | Where-Object {($_.FullName -eq $computerFQDN) -or ($_.Name -eq $computerFQDN)}
    
    
    ## Relationship classes
        # Microsoft.SystemCenter.ComputerGroupContainsComputer - Group contains Computers - Groups that contain only computers
        $relation1 = Get-SCOMRelationship -Name "Microsoft.SystemCenter.ComputerGroupContainsComputer"    
    
        # Microsoft.SystemCenter.InstanceGroupContainsEntities - Contains Entities - Relationship between an instance group and the entities that it contains
        $relation2 = Get-SCOMRelationship -Name "Microsoft.SystemCenter.InstanceGroupContainsEntities"
        
    
    ## Get SCOM Groups
        #Get-SCOMRelationshipInstance -SourceInstance $computer | ogv
        Get-SCOMRelationshipInstance -TargetInstance $computer | Where-Object {!$_.isDeleted -and 
                                                                               ( ($_.RelationshipId -eq $relation1.Id) -or ($_.RelationshipId -eq $relation2.Id) )} `
                                                               | Sort-Object SourceObject | Out-GridView

    >>

    *How many overrides was applied on Server*

    <<

    Please see:

    Export list of running Rules and Monitors for SCOM Agent

    Hope this helps

    Cheers


    Sam (Please take a moment to "Vote as Helpful" and/or "Mark as Answer" wherever applicable. Thanks!) Blog:AnalyticOps Insights Twitter:Sameer Mhaisekar

    jueves, 14 de junio de 2018 11:59

Todas las respuestas

  • >>Server is part of which group, (means it was a part of how many groups).
    Consider using the following sql statement
    select SourceObjectDisplayName  group_name from RelationshipGenericView where TargetObjectDisplayName like '%hkXXXmon01%'
    where hkXXXmon01 is the server name.
    Roger

    jueves, 14 de junio de 2018 3:51
  • thank you very much.

    Is this possible we can get by Powershell command.

    and please also suggest for below question -

     *How many overrides was applied on Server*

    jueves, 14 de junio de 2018 10:20
  • Hi,

    Please see if this script works for you:

    ## FQDN
        $computerFQDN = "computerFQDN"
    ## Get Windows Computer class
        $computerClass = Get-SCOMClass -Name "Microsoft.Windows.Computer"
    
    ## Get SCOM object # MonitoringObject (Microsoft.EnterpriseManagement.Monitoring.PartialMonitoringObject)
        $computer = Get-SCOMClassInstance -Class $computerClass | Where-Object {($_.FullName -eq $computerFQDN) -or ($_.Name -eq $computerFQDN)}
    
    
    ## Relationship classes
        # Microsoft.SystemCenter.ComputerGroupContainsComputer - Group contains Computers - Groups that contain only computers
        $relation1 = Get-SCOMRelationship -Name "Microsoft.SystemCenter.ComputerGroupContainsComputer"    
    
        # Microsoft.SystemCenter.InstanceGroupContainsEntities - Contains Entities - Relationship between an instance group and the entities that it contains
        $relation2 = Get-SCOMRelationship -Name "Microsoft.SystemCenter.InstanceGroupContainsEntities"
        
    
    ## Get SCOM Groups
        #Get-SCOMRelationshipInstance -SourceInstance $computer | ogv
        Get-SCOMRelationshipInstance -TargetInstance $computer | Where-Object {!$_.isDeleted -and 
                                                                               ( ($_.RelationshipId -eq $relation1.Id) -or ($_.RelationshipId -eq $relation2.Id) )} `
                                                               | Sort-Object SourceObject | Out-GridView

    >>

    *How many overrides was applied on Server*

    <<

    Please see:

    Export list of running Rules and Monitors for SCOM Agent

    Hope this helps

    Cheers


    Sam (Please take a moment to "Vote as Helpful" and/or "Mark as Answer" wherever applicable. Thanks!) Blog:AnalyticOps Insights Twitter:Sameer Mhaisekar

    jueves, 14 de junio de 2018 11:59