cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Alulux
Engaged Sweeper III
Hello...i tried building a report by myself, but it ended in weird output.

I would be nice if anyone can provide me a query with the following output for AD Users, so I can fine tune it by myself:


- Username
- Last Name
- First Name
- Last logon
- Disabled yes/no

sorted by last logon date.


Happy Halloween...


1 ACCEPTED SOLUTION
Hemoco
Lansweeper Alumni
The AD user status (enabled/disabled) isn't scanned by Lansweeper, so cannot be reported on. For the other information you are after, use the report below. We included user accounts for which no logon events have been detected. To use the report below, do the following:
•Open the report builder under Reports/Create New Report.
•Paste the SQL code we provided at the bottom of the page.
•Left-click somewhere in the upper section of the page so the code applies.
•Give the report a Title and hit the Save & Run button to save it. Export options are listed on the left.
Select Top 1000000 tblADusers.Username,
tblADusers.Userdomain,
tblADusers.Firstname,
tblADusers.Lastname,
Max(tblCPlogoninfo.logontime) As LastLogon
From tblADusers
Left Join tblCPlogoninfo On tblCPlogoninfo.Username = tblADusers.Username And
tblCPlogoninfo.Domain = tblADusers.Userdomain
Group By tblADusers.Username,
tblADusers.Userdomain,
tblADusers.Firstname,
tblADusers.Lastname
Order By LastLogon

View solution in original post

3 REPLIES 3
Hemoco
Lansweeper Alumni
Custom AD scanning is not possible. This feature is on our customer wish list, but we do not currently have a release date for it.
jsmith428
Engaged Sweeper
Question:

Can I modify what information Lansweeper pulls from AD for all users? For example, I created a Custom Field called "Cost Code".

In every associate's AD Profile, it contains the Cost Code. Therefore, when I am creating User to Asset relation, it would be grand for us if this information (cost code) would also appear.
Or at least configure LS to allow this needed info to auto populate along with the current AD Info which LS Replicates.

So, can this be accomplished?
Hemoco
Lansweeper Alumni
The AD user status (enabled/disabled) isn't scanned by Lansweeper, so cannot be reported on. For the other information you are after, use the report below. We included user accounts for which no logon events have been detected. To use the report below, do the following:
•Open the report builder under Reports/Create New Report.
•Paste the SQL code we provided at the bottom of the page.
•Left-click somewhere in the upper section of the page so the code applies.
•Give the report a Title and hit the Save & Run button to save it. Export options are listed on the left.
Select Top 1000000 tblADusers.Username,
tblADusers.Userdomain,
tblADusers.Firstname,
tblADusers.Lastname,
Max(tblCPlogoninfo.logontime) As LastLogon
From tblADusers
Left Join tblCPlogoninfo On tblCPlogoninfo.Username = tblADusers.Username And
tblCPlogoninfo.Domain = tblADusers.Userdomain
Group By tblADusers.Username,
tblADusers.Userdomain,
tblADusers.Firstname,
tblADusers.Lastname
Order By LastLogon