paulwetter / DocumentConfigMgrCB

This script attempts to document your entire Configuration Manager (MEMCM/SCCM) environment
https://wetterssource.com/documentconfigmgrcb
174 stars 45 forks source link

Add Client count information #102

Open abndrew82 opened 1 year ago

abndrew82 commented 1 year ago

Information can be pulled from WMI pretty easily. Currently I have customers run a SQL query as an addition to this script for documentation of their environment.

ROOT\SMS\site_SEN -class SMS_CombinedDeviceResources | Where-Object {$_.IsClient -eq "True"}

Would be nice to have this from Single Primary as well as CAS with a count per site. This appears to work in my small CAS lab to grab count per site

$SiteCodes = gwmi -namespace ROOT\SMS\site_SEN -class SMS_SiteAndSubsites | Select -ExpandProperty SiteCode
ForEach ($SiteCode in $SiteCodes)
{
$Devices = gwmi -namespace ROOT\SMS\site_SEN -class SMS_CombinedDeviceResources | Where-Object {$_.IsClient -eq "True" -and $_.SiteCode -eq $SiteCode}
Write-Host $SiteCode $Devices.Count
}
paulwetter commented 1 year ago

We already get client counts from the built in collections, all systems, etc. What is the benefit of another count of devices?