Set domain runas account for SQL Server Management Pack in SCOM

Last week the SCOM admin from my customer asked me to help out with a PowerShell command he was trying.
A little background information:
We introduced the SQL Server Management Pack in SCOM and chose to run it under domain credentials instead of local system.

First we’ll need to create a variable which stores the runas account:

Second we’ll want to get a list of names from the servers we want the Management Pack to monitor:

But SCOM doesn’t work with server names, it works with SCOM agents.
So to get a list of SCOM agents on those SQL Servers:

Next up will be to actually configure the runas account on those servers:

And last we’ll actually want to see if our actions had any effect:

Or when you want to see the actual list of servers the runas account has been distributed to, expand the SecureDistribution property:

Leave a Reply

Your email address will not be published. Required fields are marked *