‎08-02-2023 03:20 PM
I need to add a custom field in report "Active Directory: Enabled/disabled users" where I can manually write a data on each individual user. Is it possible? How can i do it?
I want that the data is stored in LanSweeper Database
Many thanks.
Solved! Go to Solution.
‎08-03-2023 04:05 PM
First of all - here is the SQL. Create a new report, give it an appropriate title for your needs.
Select Top 1000000 tblADusers.Username As Username,
tblADusers.IsEnabled As [Account Enabled?],
tblADusers.whenCreated As [Account Created],
tblADusers.LastLogon As [User Last Logged on],
extension1.Value As Description
From tblADusers
Left Join (Select tblAdProperty.Value,
tblAdProperty.AdObjectId
From tblAdProperty
Inner Join tsysAdPropertyType On tsysAdPropertyType.TypeId =
tblAdProperty.TypeId
Where tsysAdPropertyType.Name = 'ExtensionAttribute1') As extension1 On
extension1.AdObjectId = tblADusers.ADObjectID
save and run.
To edit the extensionAttribute, open Active Directory with an admin account, select view and make sure "Advanced features" is ticked. (screenshot attached)
Next open the properties for the user object you want to add the description to, and select the "Attribute Editor" tab. (screenshot attached)
Then scroll down to ExtensionAttribute1, double click it and add your description. click ok, then save all changes. (screenshot attached)
If extension attribute 1 is already being used - choose another, but you will need to change all instances of the the attribute number in the sql code too.
In Lansweeper, go to Scanning, and re-scan your active directory domain or users paths - whatever way you have it configured.
Once that scan is complete, run that report again and the information should show.
Hope that helps.
‎08-03-2023 08:01 PM
You cannot edit this data through Lansweeper. You will have to use an AD tool and have admin (or delegated rights) to change AD
‎08-03-2023 02:42 PM
The User object in active directory has a description field under the "General" tab. You can use this for whatever description you feel is suitable.
Then, in the Enable/Disable users report, edit it, and from the "tblADusers' box, select "Description". Save and run the report. The description you used in the AD user object will now show in the report. Remember to make sure Lansweeper has scanned AD after any changes you make to the description on the user object.
Hope that helps.
‎08-02-2023 05:41 PM
There is a buile in report that shows the AD status for each user. It is called Enabled/disabled users.
‎08-02-2023 08:40 PM
Yes, there is the Enabled/disabled users report, but i want to insert in this report a custom field because i want to insert a description.
This description i want to archive in LanSweeper DB.
Is it possible? How do i do?
‎08-02-2023 09:35 PM - edited ‎08-02-2023 09:39 PM
Sorry - this was wrong.
There are custom fields you can attach to asset, but I don't see a way to add one to an AD object.
‎08-03-2023 03:18 PM
Another option would be to use the "ExtensionAttribute" within the Attribute editor on the AD User object as a custom description field.
Within the Lansweeper report, the Expression 'extension1.Value' or extension2.Value' etc. could be used.
‎08-03-2023 03:34 PM
Thanks @Ian_Prentice , can you post any screens to guide me on how to do it?
‎08-03-2023 04:05 PM
First of all - here is the SQL. Create a new report, give it an appropriate title for your needs.
Select Top 1000000 tblADusers.Username As Username,
tblADusers.IsEnabled As [Account Enabled?],
tblADusers.whenCreated As [Account Created],
tblADusers.LastLogon As [User Last Logged on],
extension1.Value As Description
From tblADusers
Left Join (Select tblAdProperty.Value,
tblAdProperty.AdObjectId
From tblAdProperty
Inner Join tsysAdPropertyType On tsysAdPropertyType.TypeId =
tblAdProperty.TypeId
Where tsysAdPropertyType.Name = 'ExtensionAttribute1') As extension1 On
extension1.AdObjectId = tblADusers.ADObjectID
save and run.
To edit the extensionAttribute, open Active Directory with an admin account, select view and make sure "Advanced features" is ticked. (screenshot attached)
Next open the properties for the user object you want to add the description to, and select the "Attribute Editor" tab. (screenshot attached)
Then scroll down to ExtensionAttribute1, double click it and add your description. click ok, then save all changes. (screenshot attached)
If extension attribute 1 is already being used - choose another, but you will need to change all instances of the the attribute number in the sql code too.
In Lansweeper, go to Scanning, and re-scan your active directory domain or users paths - whatever way you have it configured.
Once that scan is complete, run that report again and the information should show.
Hope that helps.
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now