Add-SCAdvisorAgent
Applies To: System Center 2012 R2 Operations Manager
Add-SCAdvisorAgent
Adds Windows-based computers or instance groups to the group of agents that report to the Advisor Connector.
Syntax
Parameter Set: Default
Add-SCAdvisorAgent [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-InputObjects <PartialMonitoringObject[]> ] [-PipelineVariable <String> ] [-SCSession <Connection[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Add-SCAdvisorAgent cmdlet adds Windows-based computers or instance groups to the group of agents that report to the System Center Advisor Connector.
Parameters
-ComputerName<String[]>
Specifies an array of names of computers to establish connections with. The computer that you connect to must run 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? |
false |
Accept Wildcard Characters? |
false |
-Credential<PSCredential>
Specifies a PSCredential object under which the management group connection runs. To obtain a PSCredential object, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential
.
You can specify a user name in one of the following formats: User01, Domain01\User01, or User@Domain.com. The default is the current user. The cmdlet prompts you for a password.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-InputObjects<PartialMonitoringObject[]>
Specifies an array of computer names to opt in to the Advisor Connector.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-PipelineVariable<String>
Specifies a variable to use with the pipeline operator.
Aliases |
pv |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-SCSession<Connection[]>
Specifies an array of connections to a management server. The default is the current management group connection. To obtain a management group connection object, use the Get-SCOMManagementGroupConnection cmdlet.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
the current management group connection |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before executing the command.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-WhatIf
Describes what would happen if you executed the command without actually executing the command.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1: Add Windows-based computers to the connector for the current management group
The first command uses the Get-SCOMClass cmdlet to get all the Windows-based computers, and then passes them to the Get-SCOMClassInstance cmdlet by using the pipeline operator. The command stores the instances of Windows-based computers in the $WindowsComputers variable.
The second command adds all the Windows-based computers that are stored in $WindowsComputers to the group of agents that report to the Advisor Connector.
PS C:\> $WindowsComputers = Get-SCOMClass -Name "Microsoft.Windows.computer" | Get-SCOMClassInstance
PS C:\> Add-SCAdvisorAgent -InputObjects $WindowsComputers
Example 2: Add Windows computers to the connector for a specified computer
The first command uses Get-SCOMClass to get all the Windows-based computers, and then passes them to Get-SCOMClassInstance by using the pipeline operator. The command connects to the computer Computer073, and then stores the instances of Windows-based computers in the $WindowsComputers variable.
The second command adds all the Windows-based computers that are stored in $WindowsComputers to the group of agents that report to the Advisor Connector.
PS C:\> $WindowsComputers = Get-SCOMclass -Name Microsoft.Windows.computer | Get-SCOMClassInstance -ComputerName "Computer073"
PS C:\> Add-SCAdvisorAgent -InputObjects $WindowsComputers -ComputerName "Computer073"