Notification

Icon
Error

Enabled/Disabled Local/AD Admin accounts

Posted: Thursday, January 14, 2016 5:13:28 PM(UTC)
Casawi79

Casawi79

Member Original PosterPosts: 1
0
Like
This issue has been solved! Click here to view the solution
Hello,
I am trying to generate a report that provides the local admins under Users and Groups and whether they are enabled or disabled. I was able to find the following report, however it only generates the admins under Users and not the AD account under Groups. See below. Thanks.

Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblUsers.Name,
tblUsers.Fullname,
tblUsers.Accounttype,
tblUsers.Disabled,
tblUsers.Lockout,
tblUsers.PasswordChangeable,
tblUsers.PasswordExpires,
tblUsers.PasswordRequired,
tblUsers.SID,
tblUsers.Status,
tblUsers.BuildInAdmin,
tblUsers.Lastchanged
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblUsers On tblAssets.AssetID = tblUsers.AssetID
Where tblAssetCustom.State = 1
Order By tblAssets.Domain,
tblAssets.AssetName,
tblUsers.Name
Susan.A
#1Susan.A Member Administration Posts: 1,536  
posted: 1/19/2016 11:51:35 AM(UTC)
I deleted one of your other posts as it appeared to be a duplicate of this post. I included a basic report below that lists all (local and domain) accounts that are members of your computers' administrator groups. You can tick any additional fields you may need in the tblUsers table at the top of the report builder.

Keep in mind however that the tblUsers table only stores information on local Windows accounts. We don't store the status (enabled/disabled) or password settings of domain accounts for instance. This feature is on our customer wish list, but we do not have a release date for it at this time.
Code:
Select Top 1000000 tblAssets.AssetUnique,
  tblUsersInGroup.AssetID,
  tblAssets.Domain,
  tblAssets.Description,
  tblUsersInGroup.Domainname,
  tblUsersInGroup.Username,
  tblUsersInGroup.Lastchanged,
  tsysOS.Image As icon,
  tblUsers.Disabled
From tblUsersInGroup
  Inner Join tblAssets On tblUsersInGroup.AssetID = tblAssets.AssetID
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
  Left Join tblUsers On tblUsers.AssetID = tblUsersInGroup.AssetID And
    tblUsers.Name = tblUsersInGroup.Username
Where Not Exists(Select Distinct * From (Select tblAssets.AssetName As Domain,
      tblUsers.Name As Username
    From tblAssets
      Inner Join tblUsers On tblAssets.AssetID = tblUsers.AssetID
    Where tblUsers.BuildInAdmin = 1 And tblUsersInGroup.Domainname Like
      tblAssets.AssetName And tblUsersInGroup.Username Like tblUsers.Name
    Union
    Select tsysadmins.Domain,
      tsysadmins.AdminName As username
    From tsysadmins
    Where tblUsersInGroup.Domainname Like tsysadmins.Domain And
      tblUsersInGroup.Username Like tsysadmins.AdminName) DERIVEDTBL) And
  tblUsersInGroup.Admingroup = 1 And tblAssetCustom.State = 1
Order By tblAssets.AssetName
vqT4cDoP9iXyMZwoDUWU
#2vqT4cDoP9iXyMZwoDUWU Member Posts: 13  
posted: 6/17/2019 9:12:30 PM(UTC)
Is there a revised version of this report for v7?

I'm getting erratic results trying to view the presence of the local Administrator account, and whether or not it is presently disabled.

Active Discussions

Lansweeper Only 1 Basic Action not working?
by  DotWAD   Go to last post Go to first unread
Last post: Yesterday at 6:17:05 PM(UTC)
Lansweeper Mapped Drives Incorrect
by  cycleheat  
Go to last post Go to first unread
Last post: Yesterday at 5:21:32 PM(UTC)
Lansweeper Help on creating report list from security groups
by  sc00bs   Go to last post Go to first unread
Last post: Yesterday at 4:52:39 PM(UTC)
Lansweeper Will someone at Lansweeper please take my money?
by  sbAYVdQu  
Go to last post Go to first unread
Last post: Yesterday at 3:31:33 PM(UTC)
Lansweeper Monitor open process
by  Renato   Go to last post Go to first unread
Last post: Yesterday at 3:10:48 PM(UTC)
Lansweeper Duplicate assets (Servers)
by  kjstech  
Go to last post Go to first unread
Last post: Yesterday at 2:34:14 PM(UTC)
Lansweeper Office 365 32bit vs 64bit?
by  CyberCitizen   Go to last post Go to first unread
Last post: Yesterday at 7:22:38 AM(UTC)
Lansweeper "add cc user" doesn't show the correct listings
by  JLPingree  
Go to last post Go to first unread
Last post: 7/6/2020 8:12:44 PM(UTC)