Hi Everyone

I have made this script up with help from this board, that reads a excel file and then builds users into AD.

This works fine, but I have 2 domain controllers, and when the script runs, it builds the users on the active PDC and then you have to wait 5-10 minutes until Microsoft replicates the 2 domain controllers.

code:
  
$adsDomain = GetObject("LDAP://OU=Users,OU=QEH Users,DC=qeh-tr,DC=sthames,DC=nhs,DC=uk")

That is the line I am using, but can I specify a domain controller, and then what I could do is run the line twice using the DC1, then DC2.

The reason I need to do this is because I also create the home folders for the users and set permissions using CACLS, but when I run CACLS it says user does not exist.

Please help.

Thank You.

Richard