How to connect to a specific DC

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 ?
LVL 5
GitchoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David LeeCommented:
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
GitchoAuthor Commented:
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
jkaiosIT DirectorCommented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

David LeeCommented:
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
GitchoAuthor Commented:
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
David LeeCommented:
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
GitchoAuthor Commented:
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
David LeeCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GitchoAuthor Commented:
for cryin out loud !   I thought I tried that ... works just fine now :)

Thanks a ton ...
0
David LeeCommented:
Sure.  Sorry it took me so long to catch on to what you were looking for.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.