lianne143
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.Netw ork")
netPrinter.AddWindowsPrint erConnecti on UNCpath
' Here is where we set the default printer
netPrinter.SetDefaultPrint er UNCpath
UNCpath = "\\PRINT-SERVER\Colour printer"
netPrinter.AddWindowsPrint erConnecti on UNCpath
Wscript.Quit
Thanks any help would be great.
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.Netw
netPrinter.AddWindowsPrint
' Here is where we set the default printer
netPrinter.SetDefaultPrint
UNCpath = "\\PRINT-SERVER\Colour printer"
netPrinter.AddWindowsPrint
Wscript.Quit
Thanks any help would be great.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER