JSI Tip 9939. How can I determine if the domain I am logged onto is a native mode domain?

Jerold Schulman

November 30, 2005

1 Min Read
ITPro Today logo in a gray background | ITPro Today

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



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.

You May Also Like