Estimated reading time: 2 minutes
I’ve not done a post about SCCM queries for a while now so in addition to a load I did some time ago, I thought I’d bring things up to date with a few new queries starting with Microsoft Server 2019.
I’ve been using this one for creating a Windows Server 2019 collection in SCCM to deploy Microsoft Updates to it. As we use both Standard and Datacenter, it is a bit broad so you might want to tone it down a little by adding an equals Datacenter or/and Standard instead of using a wildcard like I have in this first query. I’ll add the other two queries as well though in case you do want to use them.
All Devices with Windows Server 2019 Installed
select
SMS_R_SYSTEM.ResourceID,
SMS_R_SYSTEM.ResourceType,
SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,
SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client
from
SMS_R_System
inner join SMS_G_System_OPERATING_SYSTEM
on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId
where
SMS_G_System_OPERATING_SYSTEM.Caption like "Microsoft Windows Server 2019%"
All Devices with Windows Server 2019 Datacenter Installed
select
SMS_R_SYSTEM.ResourceID,
SMS_R_SYSTEM.ResourceType,
SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,
SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client
from
SMS_R_System
inner join SMS_G_System_OPERATING_SYSTEM
on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId
where
SMS_G_System_OPERATING_SYSTEM.Caption = "Microsoft Windows Server 2019 Datacenter"
All Devices with Windows Server 2019 Standard Installed
select
SMS_R_SYSTEM.ResourceID,
SMS_R_SYSTEM.ResourceType,
SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,
SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client
from
SMS_R_System
inner join SMS_G_System_OPERATING_SYSTEM
on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId
where
SMS_G_System_OPERATING_SYSTEM.Caption = "Microsoft Windows Server 2019 Standard"
I’ll be posting some more SCCM collection queries shortly which will include Server 2016.
Feedback
If this post has helped you in any way, we would love for you to take a second and leave us a message in the comments section below. It helps us to know that there are people out there taking a look at our little part of the web!
Share this content:
its not work for me :/
I’ve just tested all of them and they all work. Are you using these for creating a SCCM collection? Are you getting any errors?
Perfect thanks!