Article ID: 259395 - Last Review: March 3, 2007 - Revision: 3.2

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

This article was previously published under Q259395
Expand all | Collapse all

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("WScript.Shell")
strDSLog = WshShell.RegRead("HKLM\System\CurrentControlSet\Services\NTDS\Parameters\Database log files path")
strDSDit = WshShell.RegRead("HKLM\System\CurrentControlSet\Services\NTDS\Parameters\DSA Working Directory")
strSysvol = WshShell.RegRead("HKLM\System\CurrentControlSet\Services\Netlogon\Parameters\Sysvol")
strSysvol = Left(strSysvol, Len(strSysvol)-7)
Set WshEnv = WshShell.Environment("SYSTEM")
WshEnv("DSLOG") = strDSLog
WshEnv("DSDIT") = strDSDit
WshEnv("SYSVOL") = 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  (http://support.microsoft.com/kb/250454/EN-US/ ) Error Returned Importing the BASICDC Security Template in Security Configuration Editor
256000  (http://support.microsoft.com/kb/256000/EN-US/ ) Error Messages After Importing Basicdc.inf into Group Policy

APPLIES TO
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
Keywords: 
kbdcpromo kbenv kbhowto KB259395
 

Article Translations