Last User Property

(imported topic written by SystemAdmin)

We had a custom property created to query the last logged on user. This property did not work for Win7/2008 because the registry key is different. I created a new property to handle the different keys. Let me know if any has comments, or a better way of doing this.

if exist current user then name of current user else (if exist it and value “DefaultUserName” of it as string != “” then value “DefaultUserName” of it as string else ((if exist it and value “LastLoggedOnUser” of it as string != “” then value “LastLoggedOnUser” of it as string else “”) of (key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI” of native registry))) of (key “HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” of native registry)

(imported comment written by BenKus)

You might check out this old post:

http://forum.bigfix.com/viewtopic.php?id=1424

Ben