?
Solved

How to connect to a specific DC

Posted on 2004-11-22
10
Medium Priority
?
629 Views
Last Modified: 2008-03-04
I want to connect to a specific DC when I create my user accounts using VBscript on my ASP page ...

Here's my binding string :
      Set objOU = GetObject("LDAP://OU=User Accounts,DC=compnay,DC=com")
      Set objUser = objOU.Create("User", "cn=jsmith"))

The script works, but it creates the accounts on my local DC (server1.company.com), which takes awhile to replicate to the main DC.  How do I create users directly on the main DC (mainserver.company.com), so they show up right away in AD ?
0
Comment
Question by:Gitcho
  • 5
  • 4
10 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 12650188
I'm not sure that'll help.  Right now you create an account on the local DC and have to wait for it to replicate to the main DC.  If instead you create an account on the main DC, then you'll have to wait for it to replicate to your local DC.  What's the difference?
0
 
LVL 5

Author Comment

by:Gitcho
ID: 12651574
We have multiple geographical locations ... replication takes longer between some DC's (sometimes many hours) than others ... so everyone is asked to work off one DC - so changes are seen immediately, and users can get up & running right away.
0
 
LVL 12

Expert Comment

by:jkaios
ID: 12652743
About adding "CN=ServerName"  to the existing PathName where <ServerName> is the actual name of the DC you want to connect to.

Set objOU = GetObject("LDAP://CN=ServerName,OU=User Accounts,DC=compnay,DC=com")
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 76

Expert Comment

by:David Lee
ID: 12653681
We too have many geographical locations but replication within our domain doesn't take hours.  If everyone is working off of one DC, and I'm not sure what you mean by that, then what's the point in having the other DCs?  How are the user's computers being forced to look at the one DC instead of going naturally to the nearest DC?
0
 
LVL 5

Author Comment

by:Gitcho
ID: 12670669
jkaios : didnt' work ...

blue : in AD, you right-click on the parent-node, and choose "Connect to Domain Controller" and choose it from the list ...

I guess it's not possible to specify.  Maybe i'll take it up with the server guys about the replication time.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12670744
Gitcho,

I know how to connect to a DC from ADUC.  But how does a user connect to a specific DC?  For example, a user wants to search AD for a printer.  How can they restrict the search to the server of their choice?  When they log in, how can they specify which server to log into?  I'm not understanding how creating a user on a specific DC helps changes to be ".. seen immediately, and users can get up & running right away".  And if there is a way to force this, then what's the point in having the other DCs?  If you really want everyone to work off of one DC, then eliminate the other DCs.

Please understand I'm not trying to be argumentative, I'm just not understanding the logic behind what it is you want to do.

-- BDF
0
 
LVL 5

Author Comment

by:Gitcho
ID: 12769552
It's OK blue ... no worries ... I'm confusing the terms here ...

Regular users won't ever have the choice of what DC they connect to ... It's done automatically when they turn on their PC (they don't even know what a DC is) ...

Helpdesk Staff (who are managing users accounts) do need to connect to a specific DC, so everyone is working from the same real-time information.

I've finally finished my form (in ASP, javascript & XML) that creates new users in AD.  When we have a list of 5 or more users to set up, we will ususally create one manually, then use that user to copy the settings.  If I create the first user, I don't want to have to wait (even 10 minutes) for that user to replicate through the DC's ...

If I can change the connection string, then I can create users on the main DC (the one we have all agreed to work off of), and no one has to wait to view their information.
0
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 12770060
Ahhh, I see.  That's easy.  Instead of

    Set objOU = GetObject("LDAP://OU=User Accounts,DC=compnay,DC=com")

try

    Set objOU = GetObject("LDAP://myserver.company.com/OU=User Accounts,DC=compnay,DC=com")


0
 
LVL 5

Author Comment

by:Gitcho
ID: 12775450
for cryin out loud !   I thought I tried that ... works just fine now :)

Thanks a ton ...
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12778927
Sure.  Sorry it took me so long to catch on to what you were looking for.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month17 days, 1 hour left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question