Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
October 12, 2006
A. The following script, which you can download here , queries the network object from a VBScript script and outputs current information.
Dim objNetOn Error Resume Next Set objNet = CreateObject("WScript.Network") If err.Number <> 0 Then 'If error occured then display notice Wscript.Echo "Error create Network object" & err.number, err.description err.ClearEnd ifWscript.Echo "User Name is " & objNet.UserNameWscript.Echo "Computer Name is " & objNet.ComputerNameWscript.Echo "Domain Name is " & objNet.UserDomainSet objNet = Nothing
You May Also Like