How To: List all servers used by your ConfigMgr Infrastructure
February 16, 2012 Leave a comment
Here’s a quick PowerShell script to show all servers used in your ConfigMgr Hierarchy:
$myServers = get-wmiobject SMS_SystemResourceList ` -namespace root\sms\site_LAB –computer LABServer $myServers | select-object servername -unique ` | sort Servername | out-gridview
You can alter that script a little to show all Roles for each server:
$myServers = get-wmiobject SMS_SystemResourceList ` -namespace root\sms\site_LAB –computer LABServer $myServers | select-object servername, RoleName ` | sort Servername | out-gridview
To run these in your environment, launch in PowerShell with proper rights to query your hierarchy, and replace “LAB” with your Central site ConfigMgr Site Code, and replace LABServer with your Central site server name.
Happy Scripting,
Greg