Enable-SCOMAgentProxy
Enable-SCOMAgentProxy
Enables agents to act as proxy agents for other computers.
Syntax
Parameter Set: FromAgent
Enable-SCOMAgentProxy [-Agent] <AgentManagedComputer[]> [[-PassThru]] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Enable-SCOMAgentProxy cmdlet enables one or more agents to act as a proxy agents and discover managed objects on other computers.
Parameters
-Agent<AgentManagedComputer[]>
Specifies an array of AgentManagedComputer objects. This parameter specifies the Operations Manager agents to enable to act as proxy agents. To obtain an AgentManagedComputer object, use the Get-SCOMADAgent cmdlet.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue, ByPropertyName) |
Accept Wildcard Characters? |
false |
-PassThru
Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
Aliases |
none |
Required? |
false |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before running the cmdlet.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
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 (https://go.microsoft.com/fwlink/p/?LinkID=113216).
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: Enable an agent to act as a proxy agent
This command gets the Operations Manager agent named server01.contoso.com and enables the agent to act as a proxy agent for other agents and agentless managed computers. The command passes the name of the agent to the DNSHostName parameter of the Get-SCOMAgent cmdlet.
PS C:\> "server01.contoso.com" | Get-SCOMAgent | Enable-SCOMAgentProxy -PassThru
Example 2: Enable agents to act as a proxy agent
This command gets all Operations Manager agents that have the ProxyingEnabled property set to $False, and then enables the agents to act as a proxy after the user confirms the action.
PS C:\> Get-SCOMAgent | Where-Object {$_.ProxyingEnabled.Value -eq $False} | Enable-SCOMAgentProxy -Confirm
Example 3: Enable an agent to act as a proxy agent by using a property value
This example enables an agent to act as an agent proxy by setting a property of the agent.
The first command gets the Operations Manager agent named server01.contoso.com, and stores it in the $Agent variable.
The second command enables the agent stored in the $Agent variable to act as a proxy agent for other computers. The command sets the ProxyingEnabled property to $True for the agent stored in the $Agent variable.
PS C:\> $Agent = Get-SCOMAgent -DNSHostName "server01.contoso.com"
PS C:\> $Agent.ProxyingEnabled