Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Logon script to add printer

Posted on 2011-02-16
6
638 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
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Resolve DNS query failed errors for Exchange
Last week, our Skyport webinar on “How to secure your Active Directory” (https://www.experts-exchange.com/videos/5810/Webinar-Is-Your-Active-Directory-as-Secure-as-You-Think.html?cid=Gene_Skyport) provided 218 attendees with a step-by-step guide for…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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 …

856 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