The below VBS script will run a command on all computers in the Active Directory OU defined by LDAPPath =

The script depends on the Windows Sysinternals tool PsExec, you will need to download and exact PsExec and place in in the same folder as the script.

In this case I am using the script and PsExec to run the command “IPConfig /flushdns” on all computers in the my “Servers” OU, the script could easily be adapted to to run something different.