Do we really use the Logonserver variable for anything? Actually we do!

If you are in a domain environment, using a workstation and you need to find out the Domain Controller that authenticated you into the domain when you logged in, here is how:
Use the CLI command: SET
Look for the logon server entry. It should display something like this:
LOGONSERVER= \\servername
you can type the following CLI command:
echo %logonserver%

It will provide you with the hostname of the logon server/domain controller that authenticated you into the domain

This can be helpful in several different cases:
1. Troubleshooting logon issues in RDP (Sometimes you may have Kerberos issues from one specific DC into the client computer causing logon delays and you need to find which server is the one communicating with the client. Once you find that, you cann run Wireshark traces to find the culprit component causing the logon delay
2. Troubleshooting logon issues in the Citrix environment (for the same reasons as the RDP logon issue described on item 1).
3. Troubleshooting slow logons, if you are running a logon script and it is taking too long to log you on. May be you Domain controller is on a remote location and it is taking longer than another DC near by. In this case force the client machine to use the closer DC.
Also, If you want to specify a domain controller that authenticates a user logon, use the environment variable %LOGONSERVER% in a PATH statement
When you specify a path statement for the user profile path, the following entry in User Manager is valid: %logonserver%\\. (see this MS article)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s