Solved

Logon script to add printer

Posted on 2011-02-16
6
640 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
[X]
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
  • 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
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
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

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Question has a verified solution.

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

This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

717 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