• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 644
  • Last Modified:

Logon script to add printer

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
garryshape
Asked:
garryshape
  • 3
  • 2
1 Solution
 
rabindrajhaCommented:
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
 
garryshapeAuthor Commented:
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
 
garryshapeAuthor Commented:
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
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
yelbaglfCommented:
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
 
garryshapeAuthor Commented:
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
 
yelbaglfCommented:
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

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now