Expand Minimize
This topic has not yet been rated - Rate this topic

Get-SCOMAgent

Updated: September 10, 2012

Applies To: System Center 2012 - Operations Manager, System Center 2012 SP1 - Operations Manager

Get-SCOMAgent

Gets the agent-managed computers in a management group.

Syntax

Parameter Set: Empty
Get-SCOMAgent [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Parameter Set: FromAgentNames
Get-SCOMAgent [-DNSHostName] <String[]> [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Parameter Set: FromManagementServer
Get-SCOMAgent [-ManagementServer] <ManagementServer> [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]




Detailed Description

The Get-SCOMAgent cmdlet gets the agent-managed computers in a management group.

Parameters

-ComputerName<String[]>

Specifies the name of a computer to establish a connection with. The computer must be running the System Center Data Access Service. The default value is the computer for the current management group connection. Valid formats include a NetBIOS name, an IP address, or a fully qualified domain name. To specify the local computer, type the computer name, "localhost", or a dot (.).


Aliases

none

Required?

false

Position?

named

Default Value

localhost

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Credential<PSCredential>

Specifies a user account under which the management group connection will run. The default is the current user. Type a user name, such as "User01", "Domain01\User01", or "User@Domain.com", or enter a PSCredential object, such as one returned by the Get-Credential cmdlet. When you type a user name, you will be prompted for a password. For more information, type Get-Help Get-Credential.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-DNSHostName<String[]>

Specifies the name of a Domain Name System (DNS) host.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-ManagementServer<ManagementServer>

Specifies the primary management server from which to retrieve all child agents. This parameter requires a management server object. For information about how to get a management server object, type Get-Help Get-SCOMManagementServer.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-SCSession<Connection[]>

Specifies a connection to a management server. The default is the current management group connection. Specify a Management group connection object, such as one returned by the Get-SCOMManagementGroupConnection cmdlet.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.EnterpriseManagement.Administration.AgentManagedComputer

Examples

-------------------------- EXAMPLE 1 --------------------------

Description

-----------

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


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

-------------------------- EXAMPLE 2 --------------------------

Description

-----------

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

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


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

-------------------------- EXAMPLE 3 --------------------------

Description

-----------

This command gets agents that are named "Server01.Contoso.com", that begin with "Server02", and that are in the domain "Contoso.com".


PS C:\>Get-SCOMAgent -Name "Server01.Contoso.com", "Server02*", "*.Contoso.com"

-------------------------- EXAMPLE 4 --------------------------

Description

-----------

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


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

Related topics

 
Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.