Solved

Logon script to add printer

Posted on 2011-02-16
6
637 Views
Last Modified: 2012-12-26
I have a conference room PC that multiple users use.
Is there a way through script or active directory to add 1 particular network printer to their profile when they logon?

The only scripts I've tried add the printer each time and causes an error if the printer's already added.
0
Comment
Question by:garryshape
  • 3
  • 2
6 Comments
 
LVL 3

Expert Comment

by:rabindrajha
ID: 34907383
not enough patience to write...but you may visit these post...apply whatever fits to you
overall it totally depends on your printer model and type...

http://support.microsoft.com/?kbid=189105
http://support.microsoft.com/?kbid=181663
http://www.msfn.org/board/topic/24608-silent-install-of-printer-included-in-wxp/
0
 

Author Comment

by:garryshape
ID: 34907491
Thanks I will try.
I've seen the "rundll32 printui.dll" thing before.
But the article says it applies to OS older than Windows XP.
0
 

Author Comment

by:garryshape
ID: 34907713
I added this vbscript in startup folder for "All Users" and it seems to work.

From:

http://www.computerperformance.co.uk/Logon/LogonScript_Printer_Bonus.htm
' SetDefaultPrinter.vbs - Windows logon script example
' PrintersDefault.vbs - Set the default printer
' VBScript - to map a network printer
' Author Guy Thomas http://computerperformance.co.uk/
' Version 1.4 - April 24th 2010
' ----------------------------------------------------'
Option Explicit
Dim objNetwork, strUNCPrinter
strUNCPrinter = "\\LittleServer\HP LaserJet 2420"
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strUNCPrinter

' Here is where we set the default printer to strUNCPrinter
objNetwork.SetDefaultPrinter strUNCPrinter
WScript.Echo "Check the Printers folder for : " & strUNCPrinter

WScript.Quit

' End of Guy's Windows logon example VBScript.

Open in new window

0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 11

Accepted Solution

by:
yelbaglf earned 500 total points
ID: 34911314
All users who log into the conference room PC will use the same printer at \\LittleServer\HP LaserJet 2420?  If so, and you don't need to add the printer based on security groups, then what you have will work fine.

You can comment out this line, so that users do not receive the popup message, by adding the apostrophe in front.

'WScript.Echo "Check the Printers folder for : " & strUNCPrinter

And if it's just the one PC, the simplest way to deploy might be just to add it to the All Users Startup folder.
0
 

Author Comment

by:garryshape
ID: 34912422
The \\server\print name is different and I changed that in the code.
I didn't see any way to make it add based on security group so I will just add that to the All Users > Start Menu > Programs > Startup folder.
Also removed the annoying echo message.

Thanks!
0
 
LVL 11

Expert Comment

by:yelbaglf
ID: 34912473
Glad to help!  For future reading material :-) you can check out ADSystemInfo, which you can use to bind to a user or computer account in AD.

http://technet.microsoft.com/en-us/library/ee198776.aspx
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question