%LOGONSERVER% Variable not Available After Logon Script

ID: Q183495


The information in this article applies to:


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          : kbbug4.00 NTSrvWkst 
Version           : WinNT:4.0
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: February 5, 1999