< Blog

List of computers from an AD User Security Group

Use this query to get a list of PCs by user’s security group. For full details see the forum post: http://social.technet.microsoft.com/Forums/en-US/configmgrreporting/thread/5180b626-b6c7-4639-a8ff-b2276f1c4cad

select 
 CS.Name0,
 CS.UserName0
from 
 dbo.v_R_User U
 join dbo.v_RA_User_UserGroupName UGN on U.ResourceID = UGN.ResourceID
 join dbo.v_GS_COMPUTER_SYSTEM CS on CS.UserName0 = U.Unique_User_Name0
Where
 UGN.User_Group_Name0 = 'GARTEK\Domain Users'