Quick PowerShell Script to list all Primary and Secondary sites with Site Version
February 17, 2012 Leave a comment
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