PDA

View Full Version : Active Directory - Printer management using GPO's?


Anonymous
20-12-04, 04:47 PM
Scenario:

We currently use roaming profiles for almost all our users here at work (5000+ node international company). With the introduction of AD and DFS, we're looking at the possibility of changing everyone to local profiles. Now, there's quite a few hurdles to overcome in this - however the one that's of most interest to me is regarding printers.

Problem (solutions?) :

I'm looking for a way to automate the addition of a selection of printers to users when they first log on to a new machine. I initially looked at using GPO's to do this by using the HKEY_CURRENT_USER registry entry, but have fast come to the conclusion that this isn't going to work due to missing print driver issues. So next I stumbled upon using the login .bat to add printers as follows:


echo Checking for installed printers

IF EXIST "%userprofile%\printers.txt" GOTO end
RUNDLL32 PRINTUI.DLL,PrintUIEntry /in /n "\\%PRINT_SRV%\printer1"
RUNDLL32 PRINTUI.DLL,PrintUIEntry /in /n "\\%PRINT_SRV%\printer2"
copy p:\printers.txt "%userprofile%\printers.txt



There by only installing the printers when the user first logs on, and also overcoming the problems with drivers.


Basically I'm just looking to see if anyone else has undergone the same sort of transition, how they achieved it, if group policy has been used in this way before, if there are any other ideas.. etc. I did have a check of all the usual resources before posting this, but I can't find anywhere that suggest that printer installation can be automated with GPO's. Bit of a shame really.

snoopy
20-12-04, 04:52 PM
transition ...l,lllllllllllll inu...........x

Sid Squid
20-12-04, 04:53 PM
Err...yeah, no...umm, yea...maybe, ermm I dunno.

What's that there Active Directory then?

Bud
20-12-04, 05:02 PM
http://www.fun4gamers.nl/showtime/fun/whatyoupost.jpg

sorry -don't ban me.

mysteryjimbo
20-12-04, 07:10 PM
Scenario:

We currently use roaming profiles for almost all our users here at work (5000+ node international company). With the introduction of AD and DFS, we're looking at the possibility of changing everyone to local profiles. Now, there's quite a few hurdles to overcome in this - however the one that's of most interest to me is regarding printers.

Problem (solutions?) :

I'm looking for a way to automate the addition of a selection of printers to users when they first log on to a new machine. I initially looked at using GPO's to do this by using the HKEY_CURRENT_USER registry entry, but have fast come to the conclusion that this isn't going to work due to missing print driver issues. So next I stumbled upon using the login .bat to add printers as follows:


echo Checking for installed printers

IF EXIST "%userprofile%\printers.txt" GOTO end
RUNDLL32 PRINTUI.DLL,PrintUIEntry /in /n "\\%PRINT_SRV%\printer1"
RUNDLL32 PRINTUI.DLL,PrintUIEntry /in /n "\\%PRINT_SRV%\printer2"
copy p:\printers.txt "%userprofile%\printers.txt



There by only installing the printers when the user first logs on, and also overcoming the problems with drivers.


Basically I'm just looking to see if anyone else has undergone the same sort of transition, how they achieved it, if group policy has been used in this way before, if there are any other ideas.. etc. I did have a check of all the usual resources before posting this, but I can't find anywhere that suggest that printer installation can be automated with GPO's. Bit of a shame really.

You're right you cant do it using GPO's and AD. Something that is missed out somehow.

You can include user logon scripts in VBscript though.

This one works.

' Set printers
' ******************************
On Error Resume Next
Dim net
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection "\\ServerUNC\Printer name"
net.SetDefaultPrinter "\\ServerUNC\Printer name"

It really is that simple. :D

mysteryjimbo
20-12-04, 07:14 PM
Oh and its

net.RemoveWindowsPrinterConnection

to get rid of one. You could simple list all the printers and remove, or if theres too many, i'm sure you could stick it in a loop with an array or something.

Anonymous
20-12-04, 07:32 PM
I don't know VBscript, my programming stops with batch files. I also only need it to run when a user first logs on to a machine.

I've also been pointed at KiXtart (http://www.kixtart.org/), which looks nice.

mysteryjimbo
20-12-04, 07:57 PM
That script is complete, theres nothing extra needed. Just change the UNC path to point to the print server and printer name.

Download the Group Policy Management Console from Microsoft too. That'll help.

Create a printer policy for each Organisational Unit grouping for printers. e.g rooms or departments with printers in. Stick the script in -User Configuration-Windows Settings-scripts-logon as a filename.vbs. Then apply the GPO to the OU.

The printers will be applied to anyone within the OU, first logon or thousandth.

TSM
20-12-04, 10:31 PM
Why not try www.kixtart.org

Cool third party free language to code the start scripts in.

You know ScriptLogic, it uses this as the underlying program.

You can do tons with it.

I used to code it so it would install printers based on if a user had access to a certian group.

mysteryjimbo
20-12-04, 10:39 PM
The problem with Kixtart is you need to install it on each workstation.

VBscript and WSHscript is native, therefore, no extras are needed. Plus that which i've already posted works.

TSM
20-12-04, 10:43 PM
You dont need to, you can execute it directly from the NETLOGON folder or whatever it is going to be on 2k/2003.

If you have 9x clients, unfortunatly you need to install a RPC program that can be done in the logon script before the Kix script starts.

Cloggsy
20-12-04, 10:45 PM
Eh :-s