Question : 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.

Answer : When a virtual workstation was last logged on?

I've attached a .vbs script that we use to do precisely this.
It records user logon times/machine usage in a users Description field so you can then view this easily from AD Users & Computers.
Run it through group policy.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
'This script should be set as a USER login script in an Active Directory GPO. It will populate 
'the 'Description' field in the AD 'Users and Computers' console for both the Computer and
'the User objects with the username of whomever logged in, the name of the PC they logged 
'into, the time they logged into it and which domain controller that they authenticated with.

On Error Resume Next

SetLocale("en-au")

Dim strDisplayMessage
Dim objSysInfo, objUser, objComputer

Set objSysInfo = CreateObject("ADSystemInfo")

Set objUser = GetObject("LDAP://" & objSysInfo.UserName)
Set objComputer = GetObject("LDAP://" & objSysInfo.ComputerName)
Set objDomain = GetObject("LDAP://rootDse")

objAuthDC = objDomain.Get("dnsHostName")

strDisplayMessage = objUser.CN & " last logged on to " & objComputer.CN & " - " & Now & " - " & objAuthDC & "."

objUser.Description = strDisplayMessage
objUser.SetInfo

objComputer.Description = strDisplayMessage
objComputer.SetInfo

WScript.Quit
Random Solutions  
 
programming4us programming4us