Hi,
Many tasks can be done remotely, perhaps using the Run method of the
wshShell object. If, however, you need to run an executable on the remote
machine, you will need to use WMI to copy the executable to the machine and
run it.
I have an example VBScript program to deploy patches to machines listed in a
text file linked here:
http://www.rlmueller.net/PatchInstall.htm
Such a program is no longer needed with WSUS, but it demonstrates how to
copy the file, run it, wait for execution to complete, and delete the file.
The operation is repeated on each computer designated in a text file. You
could instead use EnumerateDCs.vbs and loop through the recordset of Domain
Controllers.
--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab -
http://www.rlmueller.net
"/\/\o\/\/ [MVP]" <(E-Mail Removed)> wrote in message
news:701B49BB-1460-4326-8FE8-(E-Mail Removed)...
> to list all domaincontrollers on XP / 2003 you can use :
>
> dsquery server /o rdn
>
> For a good VBscript example to list the Domaincontrollers,
> see Richard L. Mueller's site :
>
> http://www.rlmueller.net/Enumerate%20DCs.htm
>
> a MSH example I will post on my blog today ;-)
>
> you can use that list to connect to the DC's and run a command.
>
> gr /\/\o\/\/
>
>
> "anonymous" wrote:
>
>> Hi,
>>
>> I'd like to know if it is possible to do the following in a CMD Shell
>> script.
>>
>> For each DomainController in DomainControllers OU
>>
>> Domain Controller = X
>>
>> run task on X
>>
>> next
>>
>>
>> Basically to enumerate the Domain Controllers in a domain and run a
>> remote
>> command against each one.
>>
>>
>>
>>
>> Thx
>>
>>
>>