Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

SOLVED Differents devices types WQL query

Status
Not open for further replies.

AurelV

New Member
Messages
4
Reaction score
0
Points
1
Hello everyone,
I come here looking for help in refining some queries for my device groups in the SCCM console.
Currently, I am looking to obtain different collections which would each group together each type of existing machine in my fleet.
For example, I would like a collection for laptops, another for hypervisors, etc. based on this query found here maybe ?
Code:
select
SMS_R_System.Name,
SMS_G_System_COMPUTER_SYSTEM.Manufacturer,
SMS_R_System.SMSAssignedSites,
SMS_R_System.IPAddresses,
SMS_R_System.IPSubnets,
SMS_R_System.OperatingSystemNameandVersion,
SMS_R_System.ResourceDomainORWorkgroup,
SMS_R_System.LastLogonUserDomain,
SMS_R_System.LastLogonUserName,
SMS_R_System.SMSUniqueIdentifier,
SMS_R_System.ResourceId,
SMS_R_System.ResourceType,
SMS_R_System.NetbiosName from SMS_R_System
inner join SMS_G_System_COMPUTER_SYSTEM
on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId
where SMS_G_System_COMPUTER_SYSTEM.Manufacturer in ("Microsoft Corporation")
 
Hello everyone,
I come here looking for help in refining some queries for my device groups in the SCCM console.
Currently, I am looking to obtain different collections which would each group together each type of existing machine in my fleet.
For example, I would like a collection for laptops, another for hypervisors, etc. based on this query found here maybe ?
Code:
select
SMS_R_System.Name,
SMS_G_System_COMPUTER_SYSTEM.Manufacturer,
SMS_R_System.SMSAssignedSites,
SMS_R_System.IPAddresses,
SMS_R_System.IPSubnets,
SMS_R_System.OperatingSystemNameandVersion,
SMS_R_System.ResourceDomainORWorkgroup,
SMS_R_System.LastLogonUserDomain,
SMS_R_System.LastLogonUserName,
SMS_R_System.SMSUniqueIdentifier,
SMS_R_System.ResourceId,
SMS_R_System.ResourceType,
SMS_R_System.NetbiosName from SMS_R_System
inner join SMS_G_System_COMPUTER_SYSTEM
on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId
where SMS_G_System_COMPUTER_SYSTEM.Manufacturer in ("Microsoft Corporation")
So what is not working for you? What error are you getting?
 
I don't have any errors, I'm just looking for a way to get what I want: collections for each type of device. The example here proposes a moderately reliable query, and only for virtual machines. I'm just wondering if there are any queries to do this or do you have to use another way?
 
I don't have any errors, I'm just looking for a way to get what I want: collections for each type of device. The example here proposes a moderately reliable query, and only for virtual machines. I'm just wondering if there are any queries to do this or do you have to use another way?
So you are looking for people write the queries for you or point you in the right direction for each item you are looking for?
 
"point you in the right direction for each article you are looking for" I lean more towards that, rather than letting someone work for me... I especially wonder if what I am trying to obtain is possible.
 
Pick one this and that you want create a WQL query on and work on that. So what are you picking?
 
Here... trying with Hypervisors. This one seems working. Right. But, my question is : is this the best way to do so ?
Code:
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_SERVER_FEATURE on SMS_G_System_SERVER_FEATURE.ResourceId = SMS_R_System.ResourceId where SMS_G_System_SERVER_FEATURE.Name = "Hyper-V"
 
Here... trying with Hypervisors. This one seems working. Right. But, my question is : is this the best way to do so ?
Code:
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_SERVER_FEATURE on SMS_G_System_SERVER_FEATURE.ResourceId = SMS_R_System.ResourceId where SMS_G_System_SERVER_FEATURE.Name = "Hyper-V"
If it works then I wouldn't worry about it. This one will tell you all of you Hyper-v servers.
 
Status
Not open for further replies.
Back
Top