‎01-31-2018 08:12 AM
‎01-31-2018 04:04 PM
Select Top 1000000 A.AssetID,
A.AssetName,
G.Username As 'User or Group Name',
G.Domainname As 'PC or Domain Name',
V.Username As 'View User Name',
(Case S.ADObjectID When (Select tblADusers.ADObjectID From tblADusers
Where tblADusers.ADObjectID = S.ADObjectID) Then 'USER'
When (Select tblADGroups.ADObjectID From tblADGroups
Where tblADGroups.ADObjectID = S.ADObjectID) Then 'GROUP' Else 'LOCAL'
End) As 'Permissions From',
G.Groupname As 'Local Group Name on Asset'
From tblAssets A
Inner Join tblUsersInGroup G On A.AssetID = G.AssetID
Inner Join tblAssetCustom C On A.AssetID = C.AssetID
Left Outer Join tblADObjects S On S.sAMAccountName = G.Username And
S.domain = G.Domainname
Left Join web50repfec49c298d2a49e3a80f08adbd7347bc V On V.ADGroupID =
S.ADObjectID
Where (G.Groupname Like '%Administrators%' Or
G.Groupname Like '%Remote Desktop Users%') And C.State = 1
Order By A.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now