Chris Nackers

ConfigMgr / SCCM

List of Computers from an Active Directory User Security Group

2012-03-25

From the archive (2012). Written for the tools of the time, so some details may be out of date.

Garth Jones (fellow ConfigMgr MVP) blogged a really great query for get a list o PC’s by using a user security group.

Read his original blog post here.

   1: select
   2: 
   3:   CS.Name0,
   4: 
   5:   CS.UserName0
   6: 
   7: from
   8: 
   9:   dbo.v_R_User U
  10: 
  11:   join dbo.v_RA_User_UserGroupName UGN on U.ResourceID = UGN.ResourceID
  12: 
  13:   join dbo.v_GS_COMPUTER_SYSTEM CS on CS.UserName0 = U.Unique_User_Name0
  14: 
  15: Where
  16: 
  17:   UGN.User_Group_Name0 = 'GARTEK\Domain Users'