Title: RE: [ActiveDir] Enumerating DCs from a workstation that is not member of domain.
Have you considered using Netdom then?  As long as you're going to shell out anyway....
Something like Netdom add machine /domain:domain should do it.
 
Al
 
NETDOM ADD machine /Domain:domain [/UserD:user]
           [/PasswordD:[password | *]] [/Server:server] [/OU:ou path]
 
NETDOM ADD Adds a workstation or server account to the domain.
 
machine is the name of the computer to be added
 
/Domain         Specifies the domain in which to create the machine account
 
/UserD          User account used to make the connection with the domain
                specified by the /Domain argument
 
/PasswordD      Password of the user account specified with /UserD.  A * means
                to prompt for the password
 
/Server         Name of a specific domain controller that should be used to
                perform the Add.
 
/OU             Organizational unit under which to create the machine account.
                This must be a fully qualified RFC 1779 DN for the OU.
                If not specified, the account will be created under the default
                organization unit for machine objects for that domain.
 
/DC             Specifies that a domain controller's machine account is to be
                created. This option cannot be used with the /OU option.
 
NETDOM HELP command | MORE displays Help one screen at a time.


From: AD [mailto:[EMAIL PROTECTED]
Sent: Saturday, May 15, 2004 5:56 AM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] Enumerating DCs from a workstation that is not me mber of domain.

Al,
 
You hit the nail on the head about my intentions. I did say vbscript or vb.net but I still appreciate that the fine folk in this forum are trying to help me.
 
I read the code in the link provided. Looks great but the workstations I am adding to the domain are w2k Pro. Just my luck. :-)
 
The problem with LDAP searching for DCs is your need to specify a DC name in your query.  You cannot perform a serverless bind unless your workstation is a member of the domain. Hard coding a server name is not an option because as we all know, servers change. I am starting to think that capturing the output of NSLookup is the only solution. Not pretty but it will work.  
 
Y

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mulnick, Al
Sent: Friday, May 14, 2004 10:12 AM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] Enumerating DCs from a workstation that is not me mber of domain.

I think the original request was that it be vbscript or vb.net.  I suppose you could wrap the call, but I'm not sure it meets what he's looking for. 
 
Additionally, I think we overcomplicated the request.  I think he just wants to be able to add to a workstation to a domain which is a script similar to http://www.microsoft.com/technet/community/scriptcenter/compmgmt/scrcm31.mspx which uses the netbios or shortname of the domain to join (as does the built in pieces).
 
Otherwise, why do you want to find the members of a domain from a non-member workstation if not to join?  Is there something else you're after?  If so, you may want to investigate LDAP searching for DC's in a domain.  You can pass the creds to the domain that are required for searching.  DNS will do it, and the DNSGetHostbyname or sister method should be helpful there. 
 
Al
 
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 6:39 PM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] Enumerating DCs from a workstation that is not me mber of domain.

This should be what you want...
http://msdn.microsoft.com/library/default.asp?url="">


From: AD [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 5:34 PM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] Enumerating DCs from a workstation that is not me mber of domain.

The problem with name resolution is the fact that you have to HARD Code your server names. That is what I am trying to stay away from.


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mulnick, Al
Sent: Thursday, May 13, 2004 4:42 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [ActiveDir] Enumerating DCs from a workstation that is not me mber of domain.

Huh?  Wouldn't the name resolution calls work better then?
http://msdn.microsoft.com/library/default.asp?url="">
 
 
 
 
Al
 
 
 
 


From: AD [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 3:46 PM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] Enumerating DCs from a workstation that is not member of domain.

Believe it or not Mike I gave that idea a lot of thought. NSLookup -t NS DomainName.com. But I would have to create a shell object, capture the output to a file and then parse it. Not the cleanest solution.
 
I was hoping to find an object that will kinda do it all.


From: [EMAIL PROTECTED] on behalf of Thommes, Michael M.
Sent: Thu 5/13/2004 10:10 AM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] Enumerating DCs from a workstation that is not member of domain.

Couldn't you just query DNS (ie, nslookup aa.bb.cc) and look at the IPs returned?

Mike Thommes

-----Original Message-----
From: AD [
mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 13, 2004 8:47 AM
To: [EMAIL PROTECTED]
Subject: [ActiveDir] Enumerating DCs from a workstation that is not
member of domain.


Hey Guys,

I am looking for a vb script or vb.net code that would return domain controllers (names or ip addresses) of a specific domain name on a workstation that is NOT member of the domain.

When you add a computer to a domain (right click "my computer", properties, Computer Name, Change) you specify a domain name. When you click on ok it will ask you for a username and password right? When you click "ok" the computer must talk with a domain controller to add your computer to the domain right? I basically need that functionality.

Thank you in advance.


Yves St-Cyr
List info   : http://www.activedir.org/mail_list.htm
List FAQ    : http://www.activedir.org/list_faq.htm
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/


List info   : http://www.activedir.org/mail_list.htm
List FAQ    : http://www.activedir.org/list_faq.htm
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

Reply via email to