What is the SQL code to check the last time a PC was logged on?
Updated: 21 May 2010 | 3 comments
Our company is looking for little used or non used PCs to recover from our user depts who claim they need the PCs. I am looking for some way to print out a list of PCs that have not been logged on to in the past 30 days....any help would be appreciated...I know some SQL and DB tables in Altiris....thanks.
Discussion Filed Under:
Comments
yusgab, following code might help. You'll need to put in a SQL datediff for the 30 day thing too.
---------
Select vc.[name], eulu.[last logon] from vComputer vc
INNER JOIN inv_aex_eu_logon_users eulu on vc.guid = eulu._resourceguid where vc.guid in
(SELECT TOP 10 [_resourceguid]
FROM [Altiris].[dbo].[Inv_AeX_EU_Logon_Users]
order by [last logon])
-----
thanks
r
find your answers from google
Sandy,
If you're not going to post anything helpful, please keep you comments to yourself.
Yusgab/Ricodjs:
I think the following code should give you what you're looking for:
What is your goal here though? Are you trying to find computers which no one has logged on to, or computers that are no longer connected to the network? If you're looking for "offline" computers, there are better built-in reports (specifically the "Clients with No Configuration in N Days" report on Reports > NS Infrastructure > Agent > Configuration Request folder.
Thanks,
Kyle
Symantec Trusted Advisor
For Forum threads, please click "Mark as Solution" if answered.
For all content, please give a thumbs up if you agree with or support the post.
Would you like to reply?
Login or Register to post your comment.