Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 30534

Re: General Purpose SQL Queries - Post them here!

$
0
0

This Query combines information from AD Patch Scan and Links to Enable\Disabled Users in Audit Results:

SELECT DISTINCT a.logonName AS 'Username', a.fullName AS 'Full Name', a.isDisabled AS 'Enabled', c.groupName, e.LastLogon

FROM         auditRsltUserAccounts AS a INNER JOIN

                     machNameTab AS b ON a.agentGuid = b.agentGuid INNER JOIN

                     machGroup AS c ON b.machGroupGuid = c.machGroupGuid INNER JOIN

                     vSystemInfoManual AS d ON a.agentGuid = d.agentGuid RIGHT OUTER JOIN

                     vkadUsers AS e ON a.logonName = e.SAMAccountName RIGHT OUTER JOIN

                     vAgentConfiguration AS f ON b.agentGuid = f.agentGuid

WHERE     (f.workgroupDomainType = 4)

We have found this to be useful for AD User reporting (Note: this is filtered to only show Domain Controller Results)


Viewing all articles
Browse latest Browse all 30534