Microsoft KB Archive/183495

= %LOGONSERVER% Variable not Available After Logon Script =

Article ID: 183495

Article Last Modified on 2/23/2007

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional Edition
 * Microsoft Windows NT Workstation 4.0 Developer Edition
 * Microsoft Windows NT Server 4.0 Standard Edition

-



This article was previously published under Q183495





SYMPTOMS
When a logon script is run, the LOGONSERVER environment variable is only available while the logon script runs. After the logon script finishes, the LOGONSERVER environment variable is no longer available to other running processes.

If a logon script is NOT run, the LOGONSERVER environment variable is available to all processes after a successful logon attempt.



CAUSE
After a logon script is run, volatile environment variables created during logon script execution are deleted from the environment, by design.

LOGONSERVER is created as a volatile environment variable to cater for the case when there are multiple networks configured with logon capabilities.

Therefore, after a logon script has been run, the LOGONSERVER environment variable is erased from the environment.



RESOLUTION
If you run logon scripts, and need access to the LOGONSERVER variable after logging on, one possible workaround is to run SETX (a Windows NT resource kit utility) from within the logon script to set a permanent environment variable based on LOGONSERVER.

For example, you could add a line like

SETX MyLogonServer %LOGONSERVER%

to the logon script to preserve the setting of the LOGONSERVER environment variable for later use.



STATUS
Microsoft has confirmed this to be a problem in Windows NT version 4.0. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Keywords: kbbug kbpending KB183495

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.