Quick PowerShell Script to list all Primary and Secondary sites with Site Version

Just a quick example for listing all your sites – run this against your central site.

#replace MySiteServer with central site server name, 
#and LAB with site code
$sites = Get-Wmiobject SMS_Site -computer MySiteServer -namespace root\sms\site_LAB
#display information to the screen
$sites | select-object ServerName, SiteCode, Status, Type, Version, BuildNumber, ReportingSiteCode | sort-object ReportingSitecode
#or if you'd like, export to a .csv
$sites | select ServerName, SiteCode, Status, Type, Version, BuildNumber, ReportingSiteCode | sort ReportingSitecode | export-csv c:\temp\ConfigMgrSites.csv -notypeinformation

Greg

About Greg Ramsey
Greg Ramsey is a Distinguished Engineer for Dell Digital - Services. He has a B.S. in Computer Sciences and Engineering from The Ohio State University and has co-authored many books over the years. Greg is also a board member of the Northwest System Center User Group and the Midwest Management Summit. ​Greg has been a Microsoft Endpoint Manager (ConfigMgr, Intune) MVP for over 14 years.

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 )

Facebook photo

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

Connecting to %s

%d bloggers like this: