Reply
Old January 31st, 2007 Top | #1
 
Punkrulz's Avatar
Somewhat eXPerienced
Joined: December 2001
Location: Woodbury, NJ
Posts: 790
Reputation: 50
Power: 131

Default How can I automatically push a printer to people?

There's always something new!!!

On one of the computers that I had recently setup, there are going to be about 7 or so people who use the computer. Now this never used to be a problem with printers, because I was directly attaching them via IP address. However, I have now started installing the printer on the server, and sharing it out that way. It's easier to find the printer and add it, while not having to get the drivers.

The problem though is while now I'm adding it as the Administrator, it's not applying to all users who login to the computer. Right now it seems that I am going to have to login to each account again, add the printer, sign off, and change the password again... that is just a time guzzler.

What is the easiest way for me to be able to install a printer on a computer, and make it available to the people who login to that printer, whether it's based on the computer itself, or a group that they're in???

CPU: Intel C2D E8400 {3.0GHz} | Mobo: Gigabyte GA-EP45-UD3R | RAM: GSkill DDR2-1000 2x2gb | HDD: Western Digital 640gb SATA | GFX: EVGA Geforce GTX-260 216c | Speakers: Creative Inspire 5200 | Operating System: Windows Vista Business x64

If you're happy with my assistance, please click on the on the left side under my name!
Punkrulz is offline   Reply With Quote
Old January 31st, 2007 Top | #2
 
celticfan11's Avatar
OSNN Senior Addict
Joined: January 2003
Location: Vernon, CT
Posts: 744
Reputation: 340
Power: 121

Default Re: How can I automatically push a printer to people?

just an FYI, when you install an IP printer in windows it installs for ALL users. When you installed a shared printer off a print server it only installs for that current user who is logged in.

And this link should help you with your problem.
http://support.microsoft.com/default...b;EN-US;189105

CPU: Intel 3.2GHz OC'd to 3.4GHz
RAM: 1GB PC3200
Harddrive: .710TB combined Local and Network storage
Video Card: Geforce 6800 GT 256MB RAM
Motherboard: ASU P4P800
Sound: Onboard sound baby
Monitor: Faithful 21 inches of PURE CRT
Number of Programs Installed: 39 and growing: not counting games, (and yes i use them all)
celticfan11 is offline   Reply With Quote
Old January 31st, 2007 Top | #3
 
Punkrulz's Avatar
Somewhat eXPerienced
Joined: December 2001
Location: Woodbury, NJ
Posts: 790
Reputation: 50
Power: 131

Default Re: How can I automatically push a printer to people?

Hmm, that will definitely take some getting used to. If I put the line that's listed in that document in the batch file, can I only use that line and nothing else, or do I need to have other lines in it to make it work? Not the best at batch files...

What about VBScript, would VBScript be a better way to do it compared to a batch file?

And yeah, I found out about it the hard way that when you add it directly it adds to all users, and by server it won't... I'm beginning to reconsider this. It's great if there's typically one user who uses a computer, but if there are a few users moving back and forth it might pose problems... I guess that's where the batch / scripts would come into play no?

CPU: Intel C2D E8400 {3.0GHz} | Mobo: Gigabyte GA-EP45-UD3R | RAM: GSkill DDR2-1000 2x2gb | HDD: Western Digital 640gb SATA | GFX: EVGA Geforce GTX-260 216c | Speakers: Creative Inspire 5200 | Operating System: Windows Vista Business x64

If you're happy with my assistance, please click on the on the left side under my name!
Punkrulz is offline   Reply With Quote
Old January 31st, 2007 Top | #4
 
celticfan11's Avatar
OSNN Senior Addict
Joined: January 2003
Location: Vernon, CT
Posts: 744
Reputation: 340
Power: 121

Default Re: How can I automatically push a printer to people?

Originally Posted by Punkrulz View Post
I'm beginning to reconsider this. It's great if there's typically one user who uses a computer, but if there are a few users moving back and forth it might pose problems... I guess that's where the batch / scripts would come into play no?
correct

i have never used login scripts to install printers. I googled and found you that website. Maybe you have a test PC you can try the script on first to see how it preforms.

Originally Posted by Punkrulz View Post
If I put the line that's listed in that document in the batch file, can I only use that line and nothing else, or do I need to have other lines in it to make it work? Not the best at batch files...
You can add as much stuff as you want in a login script. You may want to add a "pause" statement at the end of your script, when you are testing, so you can see if any error messages come up.

CPU: Intel 3.2GHz OC'd to 3.4GHz
RAM: 1GB PC3200
Harddrive: .710TB combined Local and Network storage
Video Card: Geforce 6800 GT 256MB RAM
Motherboard: ASU P4P800
Sound: Onboard sound baby
Monitor: Faithful 21 inches of PURE CRT
Number of Programs Installed: 39 and growing: not counting games, (and yes i use them all)
celticfan11 is offline   Reply With Quote
Old January 31st, 2007 Top | #5

OSNN Folding Team  
fitz's Avatar
XPista7eopard*ix
Joined: April 2004
Location: Chicagoland
Posts: 4,014
Reputation: 2947
Power: 164

Default Re: How can I automatically push a printer to people?

you can use login scripts to install printers.. if your location is small enough and you just want to install the same printers to all users at all locations, then the vbscript portion of it is pretty easy.

Code:
dim strPtrPath
dim objNetwork

strPtrPath = "\\servername\printershare"

set objNetwork = CreateObject("Wscript.Network")
objNetwork.AddWindowsPrinterConnection strPtrPath
set objNetwork = nothing
We use our login scripts to connect printers based on location which is a little more challenging.
fitz is offline   Reply With Quote
Old January 31st, 2007 Top | #6
 
Punkrulz's Avatar
Somewhat eXPerienced
Joined: December 2001
Location: Woodbury, NJ
Posts: 790
Reputation: 50
Power: 131

Default Re: How can I automatically push a printer to people?

Thanks for the script Fitz! Well I'm debating on how to do it. Right now we really don't have any users broken up into specific OU's in Active Directory. I don't see a problem though if I move them to their OU's (in my case, Council right now), and then create that script and apply the printer.

What do I have to change in that script, just the line that says the printer share?

What do I do if I want to add multiple printers to that script?

CPU: Intel C2D E8400 {3.0GHz} | Mobo: Gigabyte GA-EP45-UD3R | RAM: GSkill DDR2-1000 2x2gb | HDD: Western Digital 640gb SATA | GFX: EVGA Geforce GTX-260 216c | Speakers: Creative Inspire 5200 | Operating System: Windows Vista Business x64

If you're happy with my assistance, please click on the on the left side under my name!
Punkrulz is offline   Reply With Quote
Old January 31st, 2007 Top | #7

OSNN Folding Team  
fitz's Avatar
XPista7eopard*ix
Joined: April 2004
Location: Chicagoland
Posts: 4,014
Reputation: 2947
Power: 164

Default Re: How can I automatically push a printer to people?

You just need to change the strPtrPath to the path to your printer.

If you have multiple printers, you could ditch the variable (strPtrPath) and just manually add a line to each printer..
Code:
objNetwork.AddWindowsPrinterConnection "\\server\printer1"
objNetwork.AddWindowsPrinterConnection "\\server\printer2"
You also may want to set the default printer once it's connected
Code:
objNetwork.SetDefaultPrinter "\\server\defaultprintername"
If you really want to get fancy, you can look at using the prnadmin.dll which lets you do a lot more in terms of setting up printers but is a little more work to use (not the least of which is the need to copy the prnadmin.dll file locally to each client and register it with regsvr32.exe. If you want to look at using prnadmin, follow the Microsoft path
fitz is offline   Reply With Quote
Old January 31st, 2007 Top | #8
 
Punkrulz's Avatar
Somewhat eXPerienced
Joined: December 2001
Location: Woodbury, NJ
Posts: 790
Reputation: 50
Power: 131

Default Re: How can I automatically push a printer to people?

Thanks for your quick response!

I had already implemented your script into a vbscript, called it Council Printer. I moved all of the Council users to the Council to the newly created Council OU, and then applied the script using gpmc.msc to the Council OU. I am logged in as one of the council members now and it appears the printer was applied no problem.

I was going to ask about the default printer situation, but you have just addressed that which I greatly appreciate it.

I listed all of the steps that I took so that you could look at them and give me some advice. Do you think the approach I took is the best way to handle it? I don't see a problem breaking up the users into their specific OU's based on department, that's easy enough.

Also, how do you know that a script is either a computer script, or a user script? The script that you have given me, I applied to users... that's just what I felt was supposed to be the case.

CPU: Intel C2D E8400 {3.0GHz} | Mobo: Gigabyte GA-EP45-UD3R | RAM: GSkill DDR2-1000 2x2gb | HDD: Western Digital 640gb SATA | GFX: EVGA Geforce GTX-260 216c | Speakers: Creative Inspire 5200 | Operating System: Windows Vista Business x64

If you're happy with my assistance, please click on the on the left side under my name!
Punkrulz is offline   Reply With Quote
Old January 31st, 2007 Top | #9
 
Punkrulz's Avatar
Somewhat eXPerienced
Joined: December 2001
Location: Woodbury, NJ
Posts: 790
Reputation: 50
Power: 131

Default Re: How can I automatically push a printer to people?

Also, now I am getting an error message about line 5 character 1, object missing or something... here is my script:
Code:
dim strPtrPath
dim objNetwork
 
strPtrPath = "\\controler\clerks3500"
 
objNetwork.SetDefaultPrinter "\\controler\clerks3500"
set objNetwork = CreateObject("Wscript.Network")
objNetwork.AddWindowsPrinterConnection strPtrPath
set objNetwork = nothing

CPU: Intel C2D E8400 {3.0GHz} | Mobo: Gigabyte GA-EP45-UD3R | RAM: GSkill DDR2-1000 2x2gb | HDD: Western Digital 640gb SATA | GFX: EVGA Geforce GTX-260 216c | Speakers: Creative Inspire 5200 | Operating System: Windows Vista Business x64

If you're happy with my assistance, please click on the on the left side under my name!
Punkrulz is offline   Reply With Quote
Old January 31st, 2007 Top | #10

OSNN Folding Team  
fitz's Avatar
XPista7eopard*ix
Joined: April 2004
Location: Chicagoland
Posts: 4,014
Reputation: 2947
Power: 164

Default Re: How can I automatically push a printer to people?

your error is because you are trying to use the network object before you create it (the objNetwork) needs to be created before you can use it.

Also, you can't set the default printer to a printer that doesn't exist. If the user hasn't mapped the printer yet, the script will error out when trying to set the default printer.

The script I wrote out should be consider more of a "scriplett" as in a framework for you to build off of - I didn't include any checks and such (like, if the user already has the printer conencted, do you really need to remap it?) if you don't know much about scripting, I would advise trawling the internet and/or picking up a good book or two on scripting.

All that being said..
Code:
option explicit

'declare my variables
dim strPtrPath
dim objNetwork,objPtrList
dim bolPtrTrue
 
'set the network path to the printer
strPtrPath = "\\controler\clerks3500"
 
'Instantiate my network object
set objNetwork = CreateObject("Wscript.Network")

'Enumerate my current printers 
set objPtrList = objNetwork.EnumPrinterConnections

'Search through my list of current printers
for i = 0 to objPtrList.Count - 1 step 2
   'if I find the printer that I'm trying to connect, set my boolean variable to true
   if objPtrList.Item(intCount+1)=strPtrPath then bolPtrFound = true
next

'if the printer is not currently connected, the connect the printer and set it as the default printer
if bolPtrFound <> true then
   objNetwork.AddWindowsPrinterConnection strPtrPath
   objNetwork.SetDefaultPrinter "\\controler\clerks3500"
end if

set objNetwork = nothing
this should work fairly well if you are only mapping one printer and want it to be the default printer. If you are wanting to map multiple printers, you will need to change it around.. you could move the enumeration of printers into a function and/or maybe read it into an array and search the array to see if the printer exists.

edit: added comments to the code
----
disclaimer:
I did not test this script yet as I usually do before posting a script up here.. I cannot be held responsible for any typos or mistakes. It is a quick and dirty script I wrote up directly here.
fitz is offline   Reply With Quote
Old February 1st, 2007 Top | #11
 
Punkrulz's Avatar
Somewhat eXPerienced
Joined: December 2001
Location: Woodbury, NJ
Posts: 790
Reputation: 50
Power: 131

Default Re: How can I automatically push a printer to people?

Thanks Fitz, I implemented the script but I haven't had the chance to try it. I will give it a shot tomorrow when I am at the client!

CPU: Intel C2D E8400 {3.0GHz} | Mobo: Gigabyte GA-EP45-UD3R | RAM: GSkill DDR2-1000 2x2gb | HDD: Western Digital 640gb SATA | GFX: EVGA Geforce GTX-260 216c | Speakers: Creative Inspire 5200 | Operating System: Windows Vista Business x64

If you're happy with my assistance, please click on the on the left side under my name!
Punkrulz is offline   Reply With Quote
Old February 15th, 2007 Top | #12
 
Ron Bennett's Avatar
OSNN Junior Addict
Joined: February 2007
Posts: 6
Reputation: 0
Power: 61

Default Re: How can I automatically push a printer to people?

For my point of view desktop management tools are always a good way to remove such kind of pain. Personally I prefer Desktop Authority. It allows do that selectively what's very helpful for configuring users with needed printers throughout the office. Say users that sit in different rooms or floors get that printer that is located close to them.
Ron Bennett is offline   Reply With Quote
Old February 17th, 2007 Top | #13

OSNN Folding Team  
GEN3RIC's Avatar
OSNN Senior Addict
Joined: April 2005
Location: Woodbury, MN
Posts: 634
Reputation: 260
Power: 92

Default Re: How can I automatically push a printer to people?

What about over a domain?

I have 9 computers, and users sometimes sit at different terminals. I have two shared printers I'd like to automatically add to all users who log in to the PCs. We already have a login script from IT Services but since the group policy does not permit me to do login scripts I am confused as to how this might work.

I'd like to just set it up so any user who logs in through our domain will automatically get the printer installed - even if they havent already logged in and created a user profile.

I used to use a .bat that used rundll32 but I had to physically sit down and install on each PC for every domain user.
GEN3RIC is offline   Reply With Quote
Old February 17th, 2007 Top | #14
 
rushm001's Avatar
In the beginning......
Joined: September 2002
Location: Norfolk, UK
Posts: 3,480
Reputation: 1370
Power: 162

Default Re: How can I automatically push a printer to people?

If you install the printer as a "local" printer, but have the printer port set as the network path to the actual printer it will be installed for all users.
Attached Thumbnails
How can I automatically push a printer to people?-printer.jpg  

rushm001 is offline   Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules

Similar Threads
Thread Thread Starter Forum Replies Last Post
to receive secure wap push messages on PPC sachinjain_30 Portable Devices & Gadgets 0 November 7th, 2006 3:24pm
how much can push my cpu more?? noax963 General Hardware 1 September 21st, 2006 11:19pm
Push the Freakin' Button 1.06.3 FishBoy Windows Desktop Systems 5 November 13th, 2004 10:32am
Push bikes can be dangerous!! stewartbmw2000 Green Room 36 October 20th, 2002 11:44am
Automatically connect? ronenph1 Windows Desktop Systems 2 September 5th, 2002 6:57pm