Below you can see the structure of a fictitious domain to be taken as a reference for setting the two variables just mentioned:
Save and close the editing of the script when you think it is fair and appropriate to your needs. Run it (from a command prompt opened previously) using the command:
cscript list_all_computers_along_users_including_an_ou_and_subous.vbs> Computers.txt
the final part> Computers.txt will completely redirect the output of the script in the text file Computers.txt (unless there is created). The first three lines show the version of WSH and we do not need, delete them and save the file. Computers.txt is now ready to be provided as input to "Change Local Administrator Password On All Computers In A List". Now that we've created the file Computers.txt all the work is already done. All that remains is to run the script "Change Local Administrator Password On All Computers In A List" with cscript (in this case could be enough to start Wscript and then just double click the vbs file).
cscript change_local_administrator_password_every_computers_in_list.vbs
Wait until the window appears telling you that the script is finished. You can then access the two log files:
In the former you will find the report of errors encountered during the execution of commands.
The second one shows which computer was successfully changed the password of local administrator.
With errors.txt file, there will also be possible to distinguish the computer on which you have access through your user credentials from those to which access is not simply because they are extinct or missing. The only recommendation in such scenario that I make is to pay particular attention to the password set to go through this script, if you are active in the domain password policy on it is good that we respect them otherwise you could end up with a blank file and errors changepwd.txt full of numerical errors are difficult to understand.
Bookmarks