WQL query on SCCM - get computers from AD users group

WW-6729 371 Reputation points
2022-04-01T09:32:04.287+00:00

Hi!

I need WQL query that I will run on SCCM that will give me computers from AD users group. Is it possible to do that?

Thank you!

BR

Windows for business Windows Server Devices and deployment Set up, install, or upgrade
Windows for business Windows Server User experience Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. WW-6729 371 Reputation points
    2022-04-04T07:34:31.72+00:00

    If anyone needs solution, this will get the info needed:

    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, SMS_R_User.UniqueUserName
    FROM SMS_R_System
    JOIN SMS_UserMachineRelationship ON SMS_R_System.Name=SMS_UserMachineRelationship.MachineResourceName
    JOIN SMS_R_User ON SMS_UserMachineRelationship.UniqueUserName=SMS_R_User.UniqueUserName
    Where SMS_R_User.UniqueUserName in (select UniqueUserName from SMS_R_User where UserGroupName = "domain\AD_group")

    BR

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.