Hi all, welcome back,
It's very easy to find out the user name and the domain name of the user running a VBScript, and the computer name where it's running:
Set objNet = CreateObject("WScript.NetWork") strInfo = "User Name is " & objNet.UserName & vbCRLF & _ "Computer Name is " & objNet.ComputerName & vbCRLF & _ "Domain Name is " & objNet.UserDomain MsgBox strInfo
I hope this helps.
Cheers,
Alex (Alejandro Campos Magencio)
Hi Alex,
How could I get the domain name of a user account that I specify?
LookupAccountName API may help you here:
http://msdn.microsoft.com/en-us/library/aa379159(VS.85).aspx
Alex
my e_mail:
a26969@hotmail.com
how can I write above data into a report or table fields.
thanks.