Link to home
Start Free TrialLog in
Avatar of Teen-o
Teen-o

asked on

When a virtual workstation was last logged on?

Hi

How can I find out when a virtual workstation was last used / logged onto ?  
...preferably not trawling though event logs.

I want to confirm all the virtual pc's in our fleet are being regularly used, preferably a script that reads a text file - vb or powershell would be good.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of andoss
andoss
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That method is probably fine for a small network, however, I would hesitate using it if you have a large or geographically disperse environment, just purely because it will generate a whole heap of extra information that will replicated between your DC's.

I would suggest that you use a simple logon script that records the username, date and time to a log file on the computer or to a central repository.

For example:

echo %USERNAME% %DATE% %TIME% >> \\SERVER\SHARE\CompLogs\%COMPUTERNAME%.txt

or

echo %USERNAME% %DATE% %TIME% >> C:\Logs\%COMPUTERNAME%.txt

Maybe in an extremely large domain the amount of traffic replicated would be signficant
We have 1500 odd users in 7 different states and there was no noticeable increase in replication traffic after implementing this script.

I find the advantage to doing it this way is all the information is visible in AD next to all the other information instead of having to go searching through a txt file. You can visually see if a user hasn't logged on and delete them without having to go back and forth from a log file to AD Users & Computers.

The only real drawback is if you already use the Decription field for something else.