windows-admins / ConfigMgr

GNU General Public License v3.0
225 stars 57 forks source link

Client Health Check KMS #102

Closed Ebag333 closed 5 years ago

Ebag333 commented 5 years ago

The current field checked seems to be a lazy property and does not get updated. Query below will check for all the various KMS fields that should be being used.

select SYS.ResourceId, SYS.ResourceType, SYS.Name, SYS.SMSUniqueIdentifier, SYS.ResourceDomainORWorkgroup, SYS.Client, SMS_G_System_SOFTWARE_LICENSING_PRODUCT.IsKeyManagementServiceMachine, SMS_G_System_SOFTWARE_LICENSING_PRODUCT.DiscoveredKeyManagementServiceMachineName, SMS_G_System_SOFTWARE_LICENSING_PRODUCT.KeyManagementServiceLookupDomain, SMS_G_System_SOFTWARE_LICENSING_PRODUCT.KeyManagementServiceMachine, SMS_G_System_SOFTWARE_LICENSING_PRODUCT.IsKeyManagementServiceMachine from  SMS_R_System as SYS left join SMS_G_System_SOFTWARE_LICENSING_PRODUCT on SMS_G_System_SOFTWARE_LICENSING_PRODUCT.ResourceID = SYS.ResourceId where SMS_G_System_SOFTWARE_LICENSING_PRODUCT.PartialProductKey is not null  and not (SMS_G_System_SOFTWARE_LICENSING_PRODUCT.DiscoveredKeyManagementServiceMachineName is not null  or SMS_G_System_SOFTWARE_LICENSING_PRODUCT.KeyManagementServiceLookupDomain is not null  or SMS_G_System_SOFTWARE_LICENSING_PRODUCT.KeyManagementServiceMachine is not null  or SMS_G_System_SOFTWARE_LICENSING_PRODUCT.IsKeyManagementServiceMachine = 1)
Ebag333 commented 5 years ago
WHERE PartialProductKey is not null and not ((DiscoveredKeyManagementServiceMachineName is not null and DiscoveredKeyManagementServiceMachineName != '') or (KeyManagementServiceLookupDomain is not null and KeyManagementServiceLookupDomain != '') or (KeyManagementServiceMachine is not null and KeyManagementServiceMachine != '') or IsKeyManagementServiceMachine = 1 )
Ebag333 commented 5 years ago

Updated.