I for the most part figured out everything that was preventing me from doing all these tasks when I run the script locally. However, when I try to do it to a remote machine it takes so long. It would not be worth it working on over 1000+ printers. 1 off's ok but it must run faster. Not sure how to do this other than going to each server and only running the script locally on each server directly. I would say this script is about 80% done but the everything I am wanting it to do exists. mainly troubleshooting for what I did not accommodate for or logic errors and speed.
High level here is what the script does:
1 allows me to install the printer to multiple print servers. Enabling sharing and publishing.
- while checking if the driver and port exists and if not it installs them
-then it applies the Acceptable ACL's to the printers (this script does not like to run remotely due to permission issues but works fine locally.)
-Logging all activity
what is killing me is things like
get-printer -computer $somecomputer
get-printerport -computer $somecomputer
get-printerdriver -computer $somecomputer
all of which take 15 to 30 min to return results over a 500gb mpls circuit between primary and backup site and even if the second machine is in the local site.
But also wanted to get input from other on things I could do to improve the logic flow.