cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
hasayeret
Engaged Sweeper II
Hi guys,

We have an upcoming audit and I wanted to know if there's a way to pull a report that showed what time our users logged into the network today. I know that Lansweeper shows "last seen users" but I wanted to know if there's a way to pull out an entire log for all our users.

Thanks!!!
7 REPLIES 7
MikeMc
Champion Sweeper II
I didn't realize you were using SQL Server CE for your Lansweeper database. The above query won't work, but I did answer your question in the other topic which pulls similar info.

http://www.lansweeper.com/Forum/yaf_postsm47174_List-Last-Logon-User---Computer.aspx#post47174
MikeMc
Champion Sweeper II
The query I provided is not the most efficient in terms of processing, so it is likely taking a long time due to your environment having a much larger user base and/or logon history. You are welcome to try this simpler query:
Select Top 10000 tblADusers.Displayname,
tblADusers.Userdomain,
tblADusers.Username,
(Select Top 1 tblCPlogoninfo.logontime From tblCPlogoninfo
Where tblCPlogoninfo.Domain = tblADusers.Userdomain And
tblCPlogoninfo.Username = tblADusers.Username Order By
tblCPlogoninfo.logontime Desc) As LastLogonTime
From tblADusers
Order By tblADusers.Displayname
hasayeret
Engaged Sweeper II
MikeMc wrote:
The query I provided is not the most efficient in terms of processing, so it is likely taking a long time due to your environment having a much larger user base and/or logon history. You are welcome to try this simpler query:
Select Top 10000 tblADusers.Displayname,
tblADusers.Userdomain,
tblADusers.Username,
(Select Top 1 tblCPlogoninfo.logontime From tblCPlogoninfo
Where tblCPlogoninfo.Domain = tblADusers.Userdomain And
tblCPlogoninfo.Username = tblADusers.Username Order By
tblCPlogoninfo.logontime Desc) As LastLogonTime
From tblADusers
Order By tblADusers.Displayname


Mike,

I am getting "There was an error parsing the query. [ Token line number = 1,Token line offset = 87,Token in error = Select ]" on last one you sent me (the simpler one)
Any idea?
MikeMc
Champion Sweeper II
  1. Open your local Lansweeper website.
  2. Go to reports, and then select New Report.
  3. Name your report.
  4. Copy and paste the code in my previous post in the bottom-most window of the page.
  5. Select Save & Run.
hasayeret
Engaged Sweeper II
MikeMc wrote:
  1. Open your local Lansweeper website.
  2. Go to reports, and then select New Report.
  3. Name your report.
  4. Copy and paste the code in my previous post in the bottom-most window of the page.
  5. Select Save & Run.


When I copy it I delete all the other stuff that is in there before pasting and I hit "save and run" and it looks like it's running the report but it has been processing for about 10 minutes...

thoughts?
MikeMc
Champion Sweeper II
Perhaps this will be a start but this is the report we use to list all our domain users and the last asset they used with logon time.

Select Top 1000000 tblADusers.Displayname,
tblADusers.Userdomain,
tblADusers.Username,
T2.AssetID,
T2.AssetName,
T1.LastLogonTime
From tblADusers
Left Outer Join (Select tblCPlogoninfo.Username,
tblCPlogoninfo.Domain,
Max(tblCPlogoninfo.logontime) As LastLogonTime
From tblCPlogoninfo
Group By tblCPlogoninfo.Username,
tblCPlogoninfo.Domain) T1 On T1.Domain = tblADusers.Userdomain And
T1.Username = tblADusers.Username
Left Outer Join (Select tblAssets.AssetID,
tblAssets.AssetName,
tblCPlogoninfo.Domain,
tblCPlogoninfo.Username,
tblCPlogoninfo.logontime
From tblAssets
Inner Join tblCPlogoninfo On tblCPlogoninfo.AssetID = tblAssets.AssetID) T2
On T2.Domain = tblADusers.Userdomain And T2.Username = tblADusers.Username
And T2.logontime = T1.LastLogonTime
Order By tblADusers.Displayname
hasayeret
Engaged Sweeper II
MikeMc wrote:
Perhaps this will be a start but this is the report we use to list all our domain users and the last asset they used with logon time.

Select Top 1000000 tblADusers.Displayname,
tblADusers.Userdomain,
tblADusers.Username,
T2.AssetID,
T2.AssetName,
T1.LastLogonTime
From tblADusers
Left Outer Join (Select tblCPlogoninfo.Username,
tblCPlogoninfo.Domain,
Max(tblCPlogoninfo.logontime) As LastLogonTime
From tblCPlogoninfo
Group By tblCPlogoninfo.Username,
tblCPlogoninfo.Domain) T1 On T1.Domain = tblADusers.Userdomain And
T1.Username = tblADusers.Username
Left Outer Join (Select tblAssets.AssetID,
tblAssets.AssetName,
tblCPlogoninfo.Domain,
tblCPlogoninfo.Username,
tblCPlogoninfo.logontime
From tblAssets
Inner Join tblCPlogoninfo On tblCPlogoninfo.AssetID = tblAssets.AssetID) T2
On T2.Domain = tblADusers.Userdomain And T2.Username = tblADusers.Username
And T2.logontime = T1.LastLogonTime
Order By tblADusers.Displayname


Thank you so much! how do I use this now? (Sorry but I am VERY new to Lansweeper)