QuickTricks: How to bulk uninstall agents in OpsMgr 2012 by name in PowerShell (#SCOM, #PowerShell, #SYSCTR)

The following is a quick PowerShell script which uninstalls agents based upon matching a naming convention. This example identifies a unique naming for the servers such as those which are named with “DC” indicating they are a domain controller: (where xyz.com is the name of the domain) Get-SCOMAgent -DNSHostName *DC*.xyz.com | Disable-SCOMAgentProxy $credential = (Get-Credential)…