Link to home
Start Free TrialLog in
Avatar of lianne143
lianne143Flag for United States of America

asked on

VBS script to map network printers to all users.

Hi

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
Wscript.Quit


Thanks any help would be great.
ASKER CERTIFIED SOLUTION
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lianne143

ASKER

There is a delay in users logging when  i set to map printers through GPO.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial