Solutions Through IT

March 18, 2009

Printer Mapping .vbs logon script

Filed under: Uncategorized — solutionsthroughit @ 20:15

I’ve realised that I haven’t blogged this as yet – my script that is heavily used to populate printers for client applications on a domain (both SBS and “real” domains).  This will also work on workgroup scenario’s, providing adequate security has been setup or relaxed.  Setting up multiple shares for a colour laser printer will mean that you can have pre-sets configured for a black and white, as well as full colour printing, which should mean cheaper printing costs if the black and white configuration is set as the default printer.

Core Script

‘ Network Logon Script

On Error Resume Next

Set nwkNetwork = Wscript.CreateObject(“WScript.Network”)

Removing Old Printers

Here we can remove any old printers, or printers that are being retired.  With the On Error at the start of this script, any errors associated with removing a failed printer will be skipped over.

nwkNetwork.RemovePrinterConnection “\\SERVER\PRINTERSHARE”

Adding a Printer

Here we add all the printers on the network for all users (small sites) or for those that have specific access to groups of printers (remote sites / secure printers etc).

nwkNetwork.AddWindowsPrinterConnection "\\SERVER\PRINTERSHARE”

Setting A Default Printer

Here we set the default printer for the users that this script runs for.

nwkNetwork.SetDefaultPrinter "\\SERVER\PRINTERSHARE”

Finishing The Script

Lets make sure that we tidy up the one variable that we have used.

Set nwkNetwork = Nothing

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: