Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing DC replication with PowerShell 2

Status
Not open for further replies.

VulakAerr

IS-IT--Management
Jan 20, 2003
6
GB
Hi all,

I was wondering if anyone knew of a way of forcing replication between two domain controllers using PowerShell? I've bound to the appropriate NTDS connection using ADSI and had a look for any likely-looking methods on that object (I had hoped it would be in a similar place to where I would force replication in dssite.msc) but I don't see anything useful thus far.

So... anyone got any ideas? Thanks.
 
Code:
$shell=new-object -COM "wscript.shell"
$shell.run("cmd.exe /c repadmin /syncall")

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Hi,

Thank you for this. Unfortunately it's not quite what I had in mind. I was hoping to be able to bind to an ADSI object and perform some sort of action on that, rather than calling an external shell.

Thanks all the same.

John.
 
I'm not sure there is a direct way today. The AD team is working on a ton of cmdlets, I think to be released either with PowerShell v2 or as an add-on. I would hope this sort of functionality would be included. Quest Software's free AD cmdlets don't include this either, so using repadmin is probably your best bet right now. Unless there's something in the bowels of .Net...
 
Interesting. At least I know now that I wasn't missing anything obvious. Thanks to you both for a working solution and an explanation respectively.

Roll on v2.
 
You used to use "net accounts /sync" but I never looked into whether that did specific server to server replication, just forest wide.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top