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.

SetAgentProxyEnabled.zip