Skip navigation

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

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



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish