Microsoft KB Archive/259395

= How to Set and Maintain %DSDIT%, %DSLOG%, and %SYSVOL% Environment Variables =

Article ID: 259395

Article Last Modified on 3/3/2007

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server

-



This article was previously published under Q259395





SUMMARY
During the promotion process (Dcpromo.exe) on a domain controller, the %DSDIT%, %DSLOG%, and %SYSVOL% environment variables are set. These variables exist only during the promotion process; they are referenced in the Basicdc.inf security template. These variables may also prove to be useful for administrators. This article describes how to write a script that sets these environment variables during startup.



MORE INFORMATION
To set these environment variables on your domain controllers, copy the following text to a file named Dcenvvars.vbs: Set WshShell = CreateObject(&quot;WScript.Shell&quot;) strDSLog = WshShell.RegRead(&quot;HKLM\System\CurrentControlSet\Services\NTDS\Parameters\Database log files path&quot;) strDSDit = WshShell.RegRead(&quot;HKLM\System\CurrentControlSet\Services\NTDS\Parameters\DSA Working Directory&quot;) strSysvol = WshShell.RegRead(&quot;HKLM\System\CurrentControlSet\Services\Netlogon\Parameters\Sysvol&quot;) strSysvol = Left(strSysvol, Len(strSysvol)-7) Set WshEnv = WshShell.Environment(&quot;SYSTEM&quot;) WshEnv(&quot;DSLOG&quot;) = strDSLog WshEnv(&quot;DSDIT&quot;) = strDSDit WshEnv(&quot;SYSVOL&quot;) = strSysvol Then, in the Default Domain Controllers policy, specify the Dcenvvars.vbs script under the following section:

Computer Configuration\Windows Settings\Scripts (Startup/Shutdown)\Startup

For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:

250454 Error Returned Importing the BASICDC Security Template in Security Configuration Editor

256000 Error Messages After Importing Basicdc.inf into Group Policy

Keywords: kbdcpromo kbenv kbhowto KB259395

-

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

© Microsoft Corporation. All rights reserved.