Automate Setting Allow Agent to Act as Proxy on SCOM Agents
Hi, Mark Manty Premier Field Engineer for Microsoft here.
Many customers want an automated way to enable agents to act as proxy. Many use PowerShell scripts to perform this on a daily or weekly basis.
Kevin Holman has an excellent example of how to perform this with a PowerShell script: https://blogs.technet.com/b/kevinholman/archive/2010/11/09/how-to-set-agent-proxy-enabled-for-all-agents.aspx?Redirected=true
However, some enterprise customers may have rules in place that prevent you from running PowerShell scripts that are unsigned. While you can sign your PowerShell scripts, it can be time consuming: https://technet.microsoft.com/en-us/magazine/2008.04.powershell.aspx
This example could be scheduled to run to ensure your agents are set to allow agents to run as proxy without having to dig through your agent list or alerts to find out what agents may require this.
Let’s go.
This sample program takes one parameter:
- RMS Server name, example MyRMSServer
I ran this in a test environment and it does not have to run on a RMS or MS to work. It must meet the below requirements in order to run successfully:
- .NET 3.5 Framework
- SCOM R2 Console (User Interface installed)
- Run as account that has administrative rights to
the SCOM Management Group
Download the ZIP file SetAgentProxyEnabled.zip and extract SetAgentProxyEnabled.exe to a folder.
Open an administrative command prompt running under an account that has SCOM administrative privileges.
Change to the directory where you extracted SetAgentProxyEnabled.exe.
Run program “SetAgentProxyEnabled.exe MyRMSServer” where MyRMSServer is your RMS server name and press enter to run.
Program will list all agents that it updated and return count of updated agents. This program will also update any Management servers should they not have Proxy enabled.
Below is an example of running the tool.
Note that the server is not set to allow this agent to act as proxy.
Run the tool to update.
Now my agent has been updated to act as proxy.
Disclaimer:
This example is provided “AS IS” with no warranty expressed
or implied. Run at your own risk.
The opinions and views expressed in this
blog are those of the author and do not necessarily state or reflect those of
Microsoft.
Comments
Anonymous
January 01, 2003
Jarrad, Here is a thread discussing possible yet unlikely drawbacks. social.technet.microsoft.com/.../a373b34d-9b01-486c-a4f2-4b1f19bea46e Thanks, MarkAnonymous
July 08, 2012
Hi Mark, Would there be any reasons why you wouldnt enable proxy on all agents? Cheers, JarradAnonymous
January 08, 2014
Pingback from Enable Proxy as SCOM Console TaskAnonymous
March 22, 2014
does this work for SCOM 2012 R2 pleaseAnonymous
April 16, 2014
Worked in my lab environment SCOM 2012 R2Anonymous
August 04, 2015
Hi Mark,
After I enabled proxy on agents using your commands on SCOM 2012 R2
the agents presented a grey health state
When I remove the proxy enable the agent came back to healthy