A. The following script, which you can download here , queries the network object from a VBScript script and outputs current information.

Dim objNet
On Error Resume Next

Set objNet = CreateObject("WScript.Network")
If err.Number &lt> 0 Then 'If error occured then display notice
    Wscript.Echo "Error create Network object" & err.number, err.description
    err.Clear
End if

Wscript.Echo "User Name is " & objNet.UserName
Wscript.Echo "Computer Name is " & objNet.ComputerName
Wscript.Echo "Domain Name is " & objNet.UserDomain

Set objNet = Nothing