Solved

Logon script to add printer

Posted on 2011-02-16
6
633 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 11

Accepted Solution

by:
yelbaglf earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
Resolve DNS query failed errors for Exchange
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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 …

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now