Need help with querying users

It only displays the correct amount of members when I queried only one group like this:

select SMS_R_USER.ResourceID,SMS_R_USER.ResourceType,SMS_R_USER.Name,SMS_R_USER.UniqueUserName,SMS_R_USER.WindowsNTDomain from SMS_R_User where SMS_R_User.SecurityGroupName = "domain\\security group1"

When I tried for multiple groups like shown below, it shows 0 member. I received no error for the query though it is obviously wrong. 

select SMS_R_USER.ResourceID,SMS_R_USER.ResourceType,SMS_R_USER.Name,SMS_R_USER.UniqueUserName,SMS_R_USER.WindowsNTDomain from SMS_R_User where SMS_R_User.SecurityGroupName = "domain\\security group1" and SMS_R_User.SecurityGroupName = "domain\\security group2" and SMS_R_User.SecurityGroupName = "domain\\security group3"

Please check and help me correct it so I can get all members in one collection.

Thanks

  • Edited by serials Monday, August 25, 2014 8:54 PM Correction
August 25th, 2014 11:20pm

hi

try changing the "and" in you statement to "or"

SMS_R_User where SMS_R_User.SecurityGroupName = "domain\\security group1" or SMS_R_User.SecurityGroupName = "domain\\security group2" or SMS_R_User.SecurityGroupName = "domain\\security group3"


Free Windows Admin Tool Kit Click here and download it now
August 29th, 2014 7:09am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics