SCOM 2012: Approve pending agents through PowerShell

If you install your SCOM 2012 agents manually or through a software deployment service like SCCM then you probably have set the approve pending management setting. With this you can decide when the agent is ready to get added to SCOM.

I recently had an agent that was not populating correctly in the pending management view in SCOM. It showed up one time shortly, but when I tried to approve it, I got an error and the system was gone. I even could not see the error correctly because it was directly gone after it appeared. It was really strange, I checked everything (DNS, ports, logs, reinstalled agent), but all looked normal. As if only the approval was missing.

You can check which agents are in pending management with this SQL query (run on OperationsManager database):
select * from agentpendingaction

One thing helped to solve the problem. That was PowerShell.

The cmdlet Get-SCOMPendingManagement provides you all agents which are in pending management and with Approve-SCOMPendingManagement you can approve the agent you need to.

So open the Operations Manager Shell and enter:
Get-SCOMPendingManagement | where {$_.AgentName -eq “ServernameFQDN“} | Approve-SCOMPendingManagement

Advertisements
Post a comment or leave a trackback: Trackback URL.

Comments

  • Lee Jacobs  On March 26, 2014 at 8:14 am

    This post is great. It has saved me. Thanks

  • Mohan  On June 11, 2014 at 2:22 am

    This is Amazing Post we were searching solution for this 20000 events couldnot find better solution other than this , Many Thanks Opsmgrtipps

  • Mohan  On May 2, 2016 at 1:05 pm

    Great one..! Thanks a lot..!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: