troubleshooting Question

VBS script to map network printers to all users.

Avatar of lianne143
lianne143Flag for United States of America asked on
Scripting LanguagesPrinters and ScannersWindows Batch
3 Comments2 Solutions366 ViewsLast Modified:

We have windows 2012 DC and Windows 7 clients in our network.I have installed a black and white and colour printer on a new windows 2012 print server. I am  trying to work out how to use login scripts to map printers for users upon log on.

I found this script and i applied and now when users log in to any network PCs, the printers are mapped successfully.
I wondering, if a User-A logs and the printer gets mapped and once the User-A logs off and another User-B logs into the same PC will the printers be mapped again or if it detects the printer is already mapped will the script ignore mapping the printers again.

Please suggest and add any lines if required in the following script.

Option Explicit
Dim netPrinter, UNCpath
UNCpath = "\\PRINT-SERVER\Black and White Printer"
Set netPrinter = CreateObject("WScript.Network")
netPrinter.AddWindowsPrinterConnection UNCpath
' Here is where we set the default printer
netPrinter.SetDefaultPrinter UNCpath

UNCpath = "\\PRINT-SERVER\Colour printer"
netPrinter.AddWindowsPrinterConnection UNCpath

Thanks any help would be great.
Join our community to see this answer!
Unlock 2 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros