PC Review


Reply
Thread Tools Rate Thread

Determine if <computername> is domain member

 
 
Matt Hickman
Guest
Posts: n/a
 
      25th Aug 2006
I have a generated list of computernames and I want to determine, from
the command line, if those individual computers are members of the
domain or not. Is there a way to do this?

"netdom query /domain:<domainname> workstation" will give me a list of
workstations, but that gives me more than I want and takes an enormous
amount of time to complete.

Any ideas?

Thanks,

--
Matt Hickman

 
Reply With Quote
 
 
 
 
Michael Bednarek
Guest
Posts: n/a
 
      26th Aug 2006
On 25 Aug 2006 11:46:51 -0700, "Matt Hickman" wrote in
microsoft.public.win2000.cmdprompt.admin:

>I have a generated list of computernames and I want to determine, from
>the command line, if those individual computers are members of the
>domain or not. Is there a way to do this?
>
>"netdom query /domain:<domainname> workstation" will give me a list of
>workstations, but that gives me more than I want and takes an enormous
>amount of time to complete.


netdom also seems incredibly slow. Have you tried:
dsquery computer -name workstation
It will return the distinguished name if workstation exists, and nothing
if it doesn't.

To get a list of computer accounts, much faster than netdom:
dsquery computer
and to display only the account (computer) name:
dsquery computer -o rdn
or
dsquery computer -o samid

Details at
<http://technet2.microsoft.com/WindowsServer/en/library/46ba1426-43fd-4985-b429-cd53d3046f011033.mspx?mfr=true>.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
 
Reply With Quote
 
Jerold Schulman
Guest
Posts: n/a
 
      28th Aug 2006
On 25 Aug 2006 11:46:51 -0700, "Matt Hickman" <(E-Mail Removed)> wrote:

>I have a generated list of computernames and I want to determine, from
>the command line, if those individual computers are members of the
>domain or not. Is there a way to do this?
>
>"netdom query /domain:<domainname> workstation" will give me a list of
>workstations, but that gives me more than I want and takes an enormous
>amount of time to complete.
>
>Any ideas?
>
>Thanks,


In addition to dsquery, you can use ADFIND.EXE from tip 5898 » Freeware ADFind.
in the 'Tips & Tricks' at http://www.jsifaq.com

In the following isdom.bat file, "c:\zipnew\zcomp.txt" contains a list of computer names.

The output might look like:
"JSI009","Y"
"JSI007","Y"
"JSI003","N"
"JSI001","Y"


@echo off
setlocal ENABLEDELAYEDEXPANSION
for /f "Tokens=*" %%a in ('type "c:\zipnew\zcomp.txt"') do (
set DOM=N
for /f "Tokens=*" %%c in ('adfind -default -dsq -f "&(objectcategory=computer)(Name=%%a)"') do (
set DOM=Y
)
@echo "%%a","!DOM!"
)
endlocal

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to open LSA API on Win2k in order to determine if a computer is member of domain Nick Dakoronias Microsoft Windows 2000 Security 3 18th Oct 2007 01:08 PM
Windows cannot determine the user or computername Return valus 135 =?Utf-8?B?VGFnZ2VydA==?= Microsoft Windows 2000 Active Directory 1 30th Oct 2005 10:44 AM
Windows cannot determine the user or computername. Return value (1 =?Utf-8?B?VGFnZ2VydA==?= Microsoft Windows 2000 Active Directory 1 24th Oct 2005 09:06 PM
member server not full member of domain andy smart Microsoft Windows 2000 0 11th May 2004 03:31 PM
System cannot log you on now because domain Computername is not available. jax Windows XP General 0 10th Feb 2004 03:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:49 PM.