Windows Thread, Printers - adding them to machines by group policy? in Technical; Hi,
Does anyone know a way of doing this? I currently add them to all users on a computer by ...
-
21st June 2007, 09:43 AM #1
- Rep Power
- 14
Printers - adding them to machines by group policy?
Hi,
Does anyone know a way of doing this? I currently add them to all users on a computer by using the "rundll32 printui.dll,PrintUIEntry /ga /n" command, which works fine but isn't the worlds most managable solution!
I'll be separating the computers into OUs over the summer break and was wondering if there's a way of adding printers from our print server to each OU and setting the default printer.
Possible?
-
-
IDG Tech News
-
21st June 2007, 09:50 AM #2 Re: Printers - adding them to machines by group policy?
Take a look in the scripts section and at the myriad of printer login scripts there.
Not sure if someone has attached the UserinOU() function to it but you should be able to find a script with that in... It's used to determine if a user is in a particular OU and you can then set the default printer using that.
I have something similar setup on my own setup.
-
-
21st June 2007, 09:56 AM #3 Re: Printers - adding them to machines by group policy?
On Server 2003 R2 you can actually deploy printers using group policy its self. If you don't have that, then try this handy VB script it's what I use and it works well and reliably, it reads the OU name and maps printers accordingly.
Code:
on error resume next
Set objWshNetwork = CreateObject("WScript.Network")
Set objAdsSystemInfo = CreateObject("adsysteminfo")
Set objComputerName = GetObject("LDAP://" & objAdsSystemInfo.ComputerName)
Set objOU = GetObject(objComputerName.Parent)
strOU = replace(objOU.Name,"OU=","")
Select Case strOU
Case "228"
objWshNetwork.AddWindowsPrinterConnection "\\STORAGE\228-bw$"
objWshNetwork.SetDefaultPrinter "\\STORAGE\228-BW$"
objWshNetwork.AddWindowsPrinterConnection "\\STORAGE\228-colour$"
Case "staffroom"
objWshNetwork.AddWindowsPrinterConnection "\\STORAGE\staffroom$"
objWshNetwork.SetDefaultPrinter "\\STORAGE\staffroom$"
End Select This is an example, the one I use in practice has over 40 entries.
-
-
21st June 2007, 10:06 AM #4
- Rep Power
- 14
Re: Printers - adding them to machines by group policy?
Oooh that looks pretty nice Maniac cheers. I'm fumbling through the scripts section at the moment but most seem pretty specific for each site the person is working at!
-
-
21st June 2007, 10:27 AM #5 Re: Printers - adding them to machines by group policy?
Still using a simple kixtart for printers...
no reason to change from it [yet].
Nath
-
-
21st June 2007, 10:36 AM #6 Re: Printers - adding them to machines by group policy?
We use Kixtart too, and deploy printers based on the PC name.
I created a script that reads a printers.ini file, this is just plain text so it's very easy for those in the department without scripting skills to edit/add/remove printers.
-
-
21st June 2007, 11:15 AM #7 Re: Printers - adding them to machines by group policy?
I'm sure you can deploy printers via GP in the normal 2003 release as well? It's just that in R2 you get a nicer interface to do it
-
-
21st June 2007, 11:34 AM #8
- Rep Power
- 14
Re: Printers - adding them to machines by group policy?

Originally Posted by
TeddyKGB I'm sure you can deploy printers via
GP in the normal 2003 release as well? It's just that in R2 you get a nicer interface to do it

Any online resources that tell me how to do it without R2?
So far i've found plenty sites stating how to do it with R2 but none without :?
-
-
21st June 2007, 11:59 AM #9 Re: Printers - adding them to machines by group policy?
You cant do it without R2
Even if you have got it, I really recommened you dont use it. It seems great at first but as soon as you come to a point where you want to remove printers you have to do it exactly in the way MS wants or it is a nightmare. Im sure others can back me up on this
Ive recently started using an almost identical script to maniacs, and it works like a dream
-
-
21st June 2007, 12:00 PM #10 Re: Printers - adding them to machines by group policy?

Originally Posted by
TeddyKGB I'm sure you can deploy printers via
GP in the normal 2003 release as well? It's just that in R2 you get a nicer interface to do it

It was a new feature in 2003 R2. so no, it wasn't possible previously.
Nath.
-
-
21st June 2007, 06:53 PM #11 Re: Printers - adding them to machines by group policy?
Ah OK.. I thought there was a "deployed printers" at the highest node in a GP even in the initial release of 2003. Must just be an R2 thing.
BTW sidewinder - if I want to remove a printer I just undeploy it GP and it uninstalls it off the workstation at next refresh *smug*
-
-
22nd June 2007, 10:38 AM #12
- Rep Power
- 14
Re: Printers - adding them to machines by group policy?
Hi all,
Using Maniacs script (as it seems fairly straight forward) although I've run into some minor problems!
I've edited and added the script to my machine group OU to run at machine startup (in this case IT1).
I'm getting no error messages but at the same time I'm getting no printers added.
Is there anyway to ensure the script is running? the gpresult says it is but as nothing is happening I'm a little confused.
Script is below:
-----------------------------
on error resume next
Set objWshNetwork = CreateObject("WScript.Network")
Set objAdsSystemInfo = CreateObject("adsysteminfo")
Set objComputerName = GetObject("LDAP://" & objAdsSystemInfo.ComputerName)
Set objOU = GetObject(objComputerName.Parent)
strOU = replace(objOU.Name,"OU=","")
Select Case strOU
Case "IT1"
objWshNetwork.AddWindowsPrinterConnection "\\print\Dell1700 IT1"
objWshNetwork.SetDefaultPrinter "\\PRINT\Dell1700 IT1"
objWshNetwork.AddWindowsPrinterConnection "\\print\HP2500C IT1"
End Select
-----------------------------
What I was wondering if we need a $ after the share name or if the Case "IT1" should have the parent container in it so it'd be "Workstations,IT1"
Any suggestions? I have the awful feeling either I've done something wrong or I've missed something blatantly obvious. I've even disabled the other VB script that runs at computer startup just incase - even though it doesn't use the same variable names.
Well it's definately running at startup. Just removed a quotation mark to check it would error - which it did. So it's running without any problems yet not managing to connect to the printers. I'm going to check permissions etc now, must be something daft.
-
-
22nd June 2007, 01:49 PM #13
- Rep Power
- 14
Re: Printers - adding them to machines by group policy?
I've got something working almost the way I wanted it and posted it on the scripting section:
http://www.edugeek.net/index.php?nam...itpost&p=97523
-
SHARE:
Similar Threads
-
By ben.woods.bw in forum Windows
Replies: 1
Last Post: 4th January 2008, 04:52 PM
-
By Southwell in forum Windows
Replies: 16
Last Post: 7th December 2007, 01:28 PM
-
By sidewinder in forum Windows
Replies: 2
Last Post: 17th May 2007, 09:54 AM
-
Replies: 5
Last Post: 7th February 2007, 12:28 PM
-
By Heebeejeebee in forum Windows
Replies: 15
Last Post: 5th February 2007, 04:00 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules