Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

VB Script to connect to a specific Domain Controller and launch AD User & Computers console

$
0
0

Hi,

I am looking for VB script to connect to a specific domain controller and launch Active Directory User and Computers. We are having several DCs spanned over distant location and the current replication setup would only happen every 2 Hrs due to various reasons.

Whenever we launch AD users and computers, it would normally be connected to the nearest available DC. I am trying find out a VB script to connect to a specific domain controller and launch AD users & computers with the chosen DC connected rather than the nearest DC.

On Error Resume Next

Dim objRootLDAP, objDomain, objShell
Set objDomain = GetObject _
("LDAP://dc1-test-01/OU=Domain Controllers,DC=test,DC=com")
Set objRootLDAP = GetObject("LDAP://rootDSE")

Set objShell = CreateObject("WScript.Shell")
objShell.Run "%systemroot%\system32\dsa.msc"

WScript.Quit

I could find this script but it will only give an AD console connected to my nearest DC and not to dc1-test-01. Hope the script is incomplete.

Any help on this would be thankful.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>