I have written a few different scripts on this..
- That does an nslookup of the IP address and returns the laptop name. The laptop name has the users name in it. So I strip it out and do an LDAP lookup with it.
- That runs a powershell command of logged on user and I strip out the domain name out and do an LDAP lookup with it. (this only works on PC's and as long as there is ONLY 1 logged in user. You need to download the psloggedon.exe from Microsoft and put in the right directory.
They are both VBS scripts that are called to the UI.
Here are the script settings:
stdin=true
stdout=true
script.1.command=c:/windows/system32/cscript.exe
script.1.custom.args=/nologo,D:/Vontu/protect/plugins/scripts/Hostlookup.vbs