The %logonserver% variable isn’t available after I log on. What should I do?

A. When you log on, the logon process creates several volatile environment variables. These variables remove after the logon process completes, as the user’s environment unloads.

One of these variables is %logonserver%, which shows the domain controller (DC) that validated the user logon. This variable is useful in logon scripts and for other tasks after logon. In Windows NT 4.0, the %logonserver% variable removes after logon. To view this variable, use the following command.

echo %logonserver%<br>

If you want to use the %logonserver% variable after logon, you can use the Microsoft Windows NT Resource Kit’s Setx utility to manually set the variable into another environment variable. Enter the following command.

setx MyLogonServer %logonserver%
Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.