[windows2000] Re: A question or two about rebooting servers t

  • From: "Rod Falanga" <rfalanga@xxxxxxx>
  • To: <windows2000@xxxxxxxxxxxxx>
  • Date: Thu, 3 Oct 2002 08:07:13 -0600


Thank you, for the script!  I've got a question about line #6.  Should
it wrap (as you say it would), or should it all go onto one line?

And I assume that it is supposed to be a .BAT file, but could it also be
a .VBS file?


-----Original Message-----
 Msg: #18 in digest
From: "Sullivan, Glenn" <GSullivan@xxxxxxxxxxxxxx>
Subject: [windows2000] Re: A question or two about rebooting servers t
Date: Wed, 2 Oct 2002 13:19:33 -0400 

I just threw together a batch file that automates a domain Synch, and
thought y'all might want to take a look.

This is short and sweet, and uses two tools from the support tools
repadmin.exe and search.vbs.  It queries your AD for members of the
Controllers" OU and then runs repadmin/syncall for each domain

I am numbering the lines, because I know that line six (the important
is going to wrap.

Change lines 3 and 4 to match your domain.  As it is written, it will
all domain controllers in the "DomainName.com" domain.

1. @echo off
2. setlocal
3. set @DomainName=DomainName
4. set @DomainSuffix=com
6. for /f "tokens=4 skip=1" %%i in ('cscript //nologo
"%ProgramFiles%\Support Tools\search.vbs" "LDAP://OU=Domain
Controllers,DC=%@DomainName%,DC=%@DomainSuffix%" /p:name /q') do
/syncall %%i dc=%@DomainName%,dc=%@DomainSuffix% /force
7. endlocal

Hope this helps,

Glenn Sullivan, MCSE+I  MCDBA 
David Clark Company Inc. 

To Unsubscribe, set digest or vacation
mode or view archives use the below link.


Other related posts: