Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
November 30, 2005
I have scripted DomNative.bat to determine if the domain you are logged onto is a native mode domain.
The syntax for using DomNative.bat is:
DomNative Native
Where Native is a call directed environment variable that will contain a Y if the domain is in native mode, or an N if it is not in native mode.
DomNative.bat contains:
@echo offif {%1}=={} @echo Syntax Call DomNative Native&exit /b 1setlocalif exist "%TEMP%DomNative.vbs" goto doit@echo Set objSysInfo = CreateObject("ADSystemInfo")>"%TEMP%DomNative.vbs"@echo Wscript.Echo "Mode: " ^& objSysInfo.IsNativeMode>>"%TEMP%DomNative.vbs":doitfor /f "Tokens=2" %%c in ('cscript //Nologo "%TEMP%DomNative.vbs"') do ( set native=%%c)set ans=Nif "%native%" EQU "True" set ans=Yendlocal&set %1=%ans%exit /b 0
You May Also Like