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.
Scripting LanguagesPrinters and ScannersWindows Batch

Avatar of undefined
Last Comment
Shaun Vermaak
ASKER CERTIFIED SOLUTION
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of lianne143
lianne143
Flag of United States of America image

ASKER

There is a delay in users logging when  i set to map printers through GPO.
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Scripting Languages
Scripting Languages

A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.

30K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo