Dear Lansweeper community,
I am trying to write a report to list every computer and it's specific AD group membership. I want to use STUFF to join all AD groups containing *ROLE* into a single column. In our environment, almost every computer is member of 1 or more AD groups containing ROLE. This should be a left join to show computers that don't have a ROLE assigned. The resulting groups should be Ordered A-Z.
I have tried following the example given for monitors, but can't work it out, as AD group membership is based on multiple joins.
Left Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Left Join tblADMembership On tblADMembership.ChildAdObjectID =
tblADComputers.ADObjectID
Left Join tblADGroups On tblADMembership.ParentAdObjectID =
tblADGroups.ADObjectID
SQL 2017 has the STRING_AGG() function to achieve this, when will it be implemented in Lansweeper? It simplifies the solution to
STRING_AGG(tblADGroups.Name, ', ')