Share via


Get-SCOMAgent

Gets the agent-managed computers in a management group.

Syntax

Empty (Default)

Get-SCOMAgent
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

FromManagementServer

Get-SCOMAgent
    [-ManagementServer] <ManagementServer>
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

FromAgentNames

Get-SCOMAgent
    [-DNSHostName] <String[]>
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

Description

The Get-SCOMAgent cmdlet gets the agent-managed computers in a management group. You can specify the DNSHostName parameter to get the agent-managed computers on a Domain Name System (DNS) host, or you can specify the ManagementServer parameter to get all the child agent-managed computers for a primary management server.

Examples

Example 1: Get all agents in the management group

PS C:\>Get-SCOMAgent -ComputerName "Server01.Contoso.Com"

This command establishes a temporary connection with the computer named Server01 and gets all agents in the management group.

Example 2: Get the agents managed by a management server

PS C:\>$MgmtServer = Get-SCOMManagementServer "MgmtServer01.Contoso.com"
PS C:\> Get-SCOMAgent -ManagementServer $MgmtServer

This example gets agent-managed computers that are managed by a management server.

The first command gets the management server object named MgmtServer01.Contoso.com and stores the object in the $MgmtServer variable.

The second command gets the agents that are managed by the management server stored in $MgmtServer.

Example 3: Get agents in a management group by using the agent name

PS C:\>Get-SCOMAgent -DNSHostName "server01.contoso.com", "Server02*", "*.Contoso.com"

This command gets agents that are named server01.contoso.com, that have a name that begins with Server02, and that are in the Contoso.com domain.

Example 4: Get all agents in a domain

PS C:\>Get-SCOMAgent -DNSHostName "*.Contoso.com" -ComputerName "Server01.Contoso.com"

This command establishes a temporary connection with the computer named Server01.Contoso.com and gets all agents in the Contoso.com domain.

Parameters

-ComputerName

Specifies an array of names of computers. You can use NetBIOS names, IP addresses, or fully qualified domain names (FQDNs). To specify the local computer, type the computer name, localhost, or a dot (.).

The System Center Data Access service must be running on the computer. If you do not specify a computer, the cmdlet uses the computer for the current management group connection.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Credential

Specifies a PSCredential object for the management group connection. To obtain a PSCredential object, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential.

If you specify a computer in the ComputerName parameter, use an account that has access to that computer. The default is the current user.

Parameter properties

Type:PSCredential
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DNSHostName

Specifies the name of a Domain Name System (DNS) host of the agent-managed computer.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Name

Parameter sets

FromAgentNames
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-ManagementServer

Specifies a ManagementServer object. This parameter specifies the primary management server from which to retrieve all child agents. To obtain a ManagementServer object, use the Get-SCOMManagementServer cmdlet.

Parameter properties

Type:ManagementServer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:MS

Parameter sets

FromManagementServer
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-SCSession

Specifies an array of Connection objects. To obtain a Connection object, use the Get-SCOMManagementGroupConnection cmdlet.

A connection object represents a connection to a management server. The default is the current management group connection.

Parameter properties

Type:

Connection[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

Microsoft.EnterpriseManagement.Administration.AgentManagedComputer