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 off if \{%1\}==\{\} @echo Syntax Call DomNative Native&exit /b 1 setlocal if exist "%TEMP%\DomNative.vbs" goto doit @echo Set objSysInfo = CreateObject("ADSystemInfo")>"%TEMP%\DomNative.vbs" @echo Wscript.Echo "Mode: " ^& objSysInfo.IsNativeMode>>"%TEMP%\DomNative.vbs" :doit for /f "Tokens=2" %%c in ('cscript //Nologo "%TEMP%\DomNative.vbs"') do ( set native=%%c ) set ans=N if "%native%" EQU "True" set ans=Y endlocal&set %1=%ans% exit /b 0
0 comments
Hide comments