Original URL: | https://blogs.msdn.microsoft.com/alejacma/2008/03/11/how-to-get-the-user-running-a-vbscript/ |
Post name: | How to get the user running a VBScript |
Original author: | Alejandro Campos Magencio |
Posting date: | 2008-03-11T03:07:00+00:00 |
Hi all, welcome back,
It's very easy to find out the user name andthe domain name of the user running a VBScript, and the computername 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.UserDomainMsgBox strInfo
I hope this helps.
Cheers,
Alex (Alejandro Campos Magencio)
Comments: