is this computer on the domain? Return %errorlevel%

  • Thread starter Thread starter Babbit
  • Start date Start date
B

Babbit

Trying to write somethign that I can put into a batch file to ask if the
computer is on the domain or not. Hopefully it will return either an %
errorlevel% or the name of the domain so I can do a true/false statement.
Thanks
 
Actually, that doesn't tell you the domain that the computer is in. It will
tell you the domain of the currently-logged-in user.

For your environment, that may be the same thing. Also, the fact that a
user from any domain has logged in implies that the computer is in a domain.

Oli
 
In said:
Trying to write somethign that I can put into a batch file to ask
if the computer is on the domain or not. Hopefully it will return
either an % errorlevel% or the name of the domain so I can do a
true/false statement. Thanks

"is on the domain"
Perhaps you should explain whether you are seeking to know if
a given machine is joined to a domain.
a given user account logged on is logged on locally or to a domain.

%USERDOMAIN% may be useful in the second case.
 
Trying to write somethign that I can put into a batch file to ask if the
computer is on the domain or not. Hopefully it will return either an %
errorlevel% or the name of the domain so I can do a true/false statement.
Thanks
if defined userdnsdomain @echo %userName% on %computerName% is logged onto
%userdnsdomain%


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Back
Top