ConfigMgr : Query Machines with LocalGroupMembers where users are admins on machine

thinkpad-p1-mobile-workstation-could-suit-small-business-power-users

Enable the class LocalGroupMembers from here > http://praveenkumarsharma1.blogspot.com/2014/10/enable-members-of-all-local-groups-of.html

 

SQL Query to find domain users who are administrators on the workstations/servers

SELECT v_R_System.Netbios_Name0, v_R_System.User_Name0, v_R_System.AD_Site_Name0, LocalGroupMembers_DATA.Account00, LocalGroupMembers_DATA.Category00, LocalGroupMembers_DATA.Disabled00, LocalGroupMembers_DATA.Domain00, LocalGroupMembers_DATA.Name00,
LocalGroupMembers_DATA.Type00
FROM LocalGroupMembers_DATA INNER JOIN
v_R_System ON LocalGroupMembers_DATA.MachineID = v_R_System.ResourceID
where Name00 like ‘%Administrators%’ and Type00 like ‘%Domain%’ and Category00 like ‘%UserAccount%’

Output :

sql-query-output

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s