I am currently working to try and design a Powershell script to change the credentials of our management agents. We utilize a service account for the management agents to connect to our SQL Database (for the SQL agents) and to connect to our Active Directory Forest (for the Active Directory agents). The password for this service account is changed on a schedule, but this require manually updating the password for each agent via the Management Agent Designer. I would like to roll this task into a script to expedite and simplify the process.
After some research, so far I am able to enumerate the management agents:
#Get wmi object for management agents $MAs = get-wmiobject -class "MIIS_ManagementAgent" -namespace "root\MicrosoftIdentityIntegrationServer" #Iterate and and perform respective actions on AD and SQL agents foreach ($MA in $MAs) { if ($MA.type -eq "Active Directory") { #Looking for actions to perform here } elseif ($MA.type -eq "SQL Server") { #Looking for actions to perform here } }
After much research, I'm having a difficult time locating an object or a method which can make the change I'm aiming for and was hoping to try and get some insight.
Regards,