Enabling Agent Proxy for all System Center Operations Manager Agents

SCOM is likley to require the proxy to be enabled on a large number of agents, certainly it is the case with a lot of the management packs and it can often be easier to enable it on all agents and then turn it off on the agents which don’t require it.

In any case, enabling the SCOM agent proxy on all agents is a simple power-shell one liner:

Get-SCOMAgent | where {$_.ProxyingEnabled.Value -eq $False} | Enable-SCOMAgentProxy

You can always modify the filter as required to match your own needs.  For example, to only enable the proxy on Agents installed within the last 3 months:

Get-SCOMAgent | where {$_.InstallTime -gt ((Get-Date).AddMonths(-3))} | Enable-SCOMAgentProxy

Message tracking in Exchange 2010 Error: “String was not recognized as a valid DateTime.”

When attempting to run message tracking on an Exchange 2010 server you get an error similar to this: Cannot process argument transformation on parameter ‘Start’. Cannot convert value to type “System.DateTime”. Error: “String was not recognized as a valid DateTime.”

Message Tracking Error

Can you spot the difference?  Even if the server has a non US regional setting you have to specify the date in US format. e.g. 08/22/2013 instead of 22/08/2013.

SharePoint management shell commands fail with access denied when using run-as

I often log on with a non privileged account and then execute individual applications or scripts as a privileged account using the “run as” feature found in windows.  Unfortunately it seems with the sharepoint management shell that this often fails with access denied.

 

error message

First double check you are sure the account your using is correct, is in the farm administrators group and has shell access (try Get-SPShellAdmin and if you don’t have it get a user who is a shell admin to add you with Add-SPShellAdmin with no database specified.)

I found that actually logging on as the privileged user worked around the error.  It is a shame as it means working interactively as an admin which always introduces a little bit of risk and I personally like the safety net of having to explicitly run something as admin if I want to make changes.

No error message

 

Notice the change in background colour and the window title when run directly instead of with the run as option.