Thursday, May 19, 2011

Identify Domain Memebership

Here is the batch file script which you can used to find if a computer is member of a domain or in workgroup.

Script #1 – Using Systeminfo command

FOR /f %%i in (c:\computers.txt) do (

echo %%i >> c:\output.txt

systeminfo /s %%i | find "Domain" >> c:\output.txt)

Script #2 – By checking the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon/DefaultDomainName reg key

FOR /f %%i in (c:\computers.txt) do (

echo %%i >> c:\output.txt

reg query "\\%%i\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /V DefaultDomainName /s | find "DefaultDomainName" >> c:\output.txt)

If you want use the Script #2, make sure the  the remote registry service is running on the computer.  Also, my assumption is t if HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon/DefaultDomainName  is not present, this computer is part of a WORKGROUP.

I create this script based on a question posted on the TechNet forum


All the basic information about every celebrity is available now on the largest database of celebrity heights where you can find all the information and heights of a singer, actor, businessman...

They have vast experience and many years of experience in the field of scientific activity and already have a large number of work done behind them, which managed to write my annotated bibliography surrender perfectly well. A professional essay can only be completed by a professional, and we can boast of having such personnel.

Post a Comment

Popular Posts


Twitter Delicious Facebook Digg Stumbleupon Favorites More