Option Explicit
On Error Resume Next
Dim objShell
Dim regLogonUserName, LogonUserName
Dim regExchangeLogonDomain, ExchangeLogonDomain
Dim regGPServer, GPServer
Dim regUserHome, UserHome
Dim regHomePath, HomePath
Dim regLogonServer, LogonServer
Dim regUserDNSDomain, UserDNSDomain
regLogonUserName = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Logon User Name"
regExchangeLogonDomain = "HKEY_CURRENT_USER\Software\Microsoft\Exchange\LogonDomain"
regGPServer = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Group Policy\History\DCName"
regUserHome = "HKEY_CURRENT_USER\Volatile Environment\HomeShare"
regHomePath = "HKEY_CURRENT_USER\Volatile Environment\HomePath"
regLogonServer = "HKEY_CURRENT_USER\Volatile Environment\LOGONSERVER"
regUserDNSDomain = "HKEY_CURRENT_USER\Volatile Environment\USERDNSDOMAIN"
Set objShell = CreateObject("WScript.Shell")
LogonUserName = objShell.RegRead(regLogonUserName)
ExchangeLogonDomain = objShell.RegRead(regExchangeLogonDomain)
GPServer = objShell.RegRead(regGPServer)
UserHome = objShell.RegRead(regUserHome)
HomePath = objShell.RegRead(regHomePath)
LogonServer = objShell.RegRead(regLogonServer)
UserDNSDomain = objShell.RegRead(regUserDNSDomain)
WScript.Echo LogonUserName & " is currently Logged on"
WScript.Echo ExchangeLogonDomain & " is the current logon domain"
WScript.Echo GPServer & " is the current Group Policy Server"
WScript.Echo UserHome & " is the user's HomeShare directory"
WScript.Echo HomePath & " is the user's HomePath directory"
WScript.Echo LogonServer & " is the current logon server"
WScript.Echo UserDNSdomain & " is the current DNS domain"