Jump to content


coolsport00

Device Collection Query - Windows Server 2019/2022

Recommended Posts

Hello!

I've searched around the interwebz and can't seem to get a WQL Device Collection query to work for 2016-2022. My limiting collection is All Systems. I was able to do a query for 'All Servers' I used from this site: https://www.andersrodland.com/ultimate-sccm-querie-collection-list/ , and I got all my Windows Servers fine.

But, when I attempt the poster's Win2016 query, and even change the build number for both 2019(10.0.17763) and 2022 (10.0.20348), nothing returns. I even played around with the number syntax a bit, using like "10.0.17%"  and  = "10.0.17763"  , etc. I found a few different queries from sites that folks have posted that worked for them, but to this point nothing works for me. I tried to use a different limiting collection >> my All Servers collection, rather than All Systems. Still no joy. Now, if I use any of the queries I found and the end of my query is like: 
where SMS_R_System.OperatingSystemNameandVersion like "Microsoft Windows NT Server 10%" , or 10.0%,  it works. Problem of course with this syntax, if you don't immediately notice, is the Build number. This returns all Server versions from 2016-2022, so the query isn't doing what I actually want, though it is returning values (devices) based off the query syntax. But when I add the second period and Build Number, poof...no worky.

Soooo....what am I doing wrong here? I've spent all afternoon piddling with this...thanks in advance! :) 

Share this post


Link to post
Share on other sites

Ok...I figured out the issue here. I looked at another website by SCCM guru Prajwal Desai. When doing searches on how to do things in SCCM, Internet searches tend to have his site at or near the top. Anyway, I went to his Blog and reviewed what he did to create a Win Serv 2022 Collection. In his process, he showed how he got the 2022 Build Number -> via a device's Properties in SCCM. I noticed something in his Console when he viewed his 2022 server device Properties... the 2022 device had the Client on it. I have Server systems in my Console/SCCM DB, but we don't install the SCCM Client on server-specific devices (don't recall why off-hand...I took over our SCCM system just 1.5yrs ago & it was decided before me to not install it on them). Anyway, long story short..to be able to use a Version or Build Number as part of your Collection Query, SCCM has to be able to 'see' that specific data, I assume, from a device's Properties. When looking at client  device Properties without the Client installed, the only referenceable data shown in a device's Properties is "Microsoft Windows NT Server 10.0" for any version from 2016 to 2022. There is no further granular-specific Build Number, Version, or even 'Caption' info beyond the "10.0" data in the client Properties. So running a Query with any characters beyond 10.0 (i.e. having another 'dot' and then specific Build or Version Number) won't retrieve any devices. The only way I believe you can get this server-specific Query to work is to segregate server Versions by OU in AD then just retrieve devices from the OU rather than via Build or Version Number, or by simply installing the Client so other Properties data will show (btw, I did test this by installing the Client on 1 of my server devices and then the Query from Prajwal's site worked); unless there's another way I'm not familiar with. I'm open to other suggestions if anyone has them. 

Thanks!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.