Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bg
Engaged Sweeper

Hi,

We keep our servers in AD groups to track what patching group they are in.

Is there a way to add a query of the computers AD group to the patch tuesday audit?

 

5 REPLIES 5
Mister_Nobody
Honored Sweeper III

Change filter as your groups names

 tblADGroups.Name Like 'wsus%' 

Thank you very much, this and your other comment below about where to insert this into the code worked.

Very much appreciate your help!

 

Mister_Nobody
Honored Sweeper III

I use this:

 Stuff((Select ', ' + tblADGroups.Name As [text()]
    From tblADMembership Inner Join tblADComputers On
          tblADMembership.ChildAdObjectID = tblADComputers.ADObjectID And
          tblassets.AssetID = tblADComputers.AssetID Inner Join tblADGroups On
          tblADMembership.ParentAdObjectID = tblADGroups.ADObjectID
    Where tblADComputers.assetid = tblassets.AssetID And
      tblADGroups.Name Like 'wsus%' For Xml Path('')), 1, 2, '') groups,

Thank you! 

I tried to insert this at the bottom on the patch tuesday audit, but I received an error. 

I'm not super SQL savy, is there a certain area of the code I should insert this into?

 

Invalid SELECT statement. Unexpected token "Stuff" at line 261, pos 3.

Mister_Nobody
Honored Sweeper III

Insert after 

tblAssets.AssetName,
tblAssets.Domain,