Quantcast
Channel: Ivanti User Community: Message List
Viewing all articles
Browse latest Browse all 12704

Re: SQL Query on LocalGroups Members

$
0
0

only SQL 2012 supports the CONCAT function.

 

This is how to do it on a lesser SQL: (in my case it's SQL 2008.)

 

SELECT DISTINCT A0.DISPLAYNAME AS "Device Name", A1.NAME AS "Name", A1.MEMBERS AS "Members"

FROM Computer A0 (nolock) LEFT OUTER JOIN LocalGroups A1 (nolock) ON A0.Computer_Idn = A1.Computer_Idn

WHERE (A1.NAME = N'Administrators') and (A1.MEMBERS LIKE '%' + A0.DISPLAYNAME + '\%') 

ORDER BY  A0.DISPLAYNAME


Viewing all articles
Browse latest Browse all 12704

Trending Articles