Jump to content

Recommended Posts

Posted

You need to work out the exact printer name, as its not always the same as the display one, I think I poked around in the registry for the ms document one. This is run as a *startup* script (vbs) in the machine section of the policy as system is allowed to add and remove printers

 

strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters =  objWMIService.ExecQuery ("SELECT * FROM Win32_Printer")
For Each objPrinter in colInstalledPrinters
IF objPrinter.Name = "Microsoft Office Document Image Writer" THEN
	objPrinter.Delete_
END IF
Next

 

 

Edit, as I don't know much about wmi scripting, I'm not sure if you can use a wild card for all local printer deletion.

Posted
This was the bit I'm unsure of here - I upgraded to R2

Checked the Schema version - its showing Version 31 - which as i understand it - is correct for PMC to work

 

Or is there something else I must do?

 

Taken from this document: http://download.microsoft.com/download/6/7/3/6736027c-35dc-47e2-9543-83e0c1037000/R2SchemaUpdate.doc

 

To apply Windows Server 2003 R2 schema extensions to the Active Directory schema

1. Insert the second Windows Server 2003 R2 installation disc in the CD drive of the domain controller that holds the schema master operations role (also known as flexible single master operations (FSMO)).

2. Log on to the computer as a member of the Schema Admins group.

3. Click Start, point to All Programs, point to Accessories, and then click Command Prompt.

4. At the command prompt, type the following commands, substituting the drive letter of the CD drive for drive:

drive:

cd \cmpnents\R2\adprep

adprep /forestprep

Posted

My experiences with R2 Print Management have been mixed.

 

Key points are

 

There is NO way to set the default with it, so if you have a local printer or want to deploy more than one to a room, you may want to run a small vbs script when the user logs in to set the correct default printer.

 

If PUSHPRINTERCONNECTIONS.EXE is causing reboots, or not working, check your Anti-Virus settings. I was getting this problem, until I unticked a box in McAfee v8 that stopped users from running .exe files in the windows system folders.

 

Other than that it seems to be pretty good.

 

Regards,

 

Anthony.

Posted

Apologies first off.

 

It seems that the flashpaper on the server solution is a crap idea and doesn't work. It seems to be alright for a while but its started failing. I've have to reinstall the local driver on the machines and use a startup script to do the default printer using a vbs script.

  • 2 weeks later...
Posted

I use DEFPRINT to set the default

 

http://www.netadmintools.com/art194.html

 

Kinda fiddly but seems to work. You need to share the printers as it sets the default using that name.

 

I made a batch file which copies the DEFPRINT batch file to the startup menu on the computer which I put in the same OU as the PRINTERCONNECTIONS.EXE

 

The startup batch file only has \\servername\apps$\defprint /d "LRC2_B" in it which is the mapping to the defprint application and LRC2_B which is the share name of the app.

 

It works quite quickly too. The only think I have found is that the printers take a minute to appear so sometimes the script has already finished before the printer has appeared. This isn't an issue with the pupils who have mandatory profiles but does slow up with staff with unlocked profiles.

 

I can't get the user assigned printers to work so just went back to putting it in the logon script.

 

One thing I have found annoying is I wanted to delete all the remnants of the old printers so I put in a con2prt.exe /P in a logoff script but it didn't touch them. The script was working just the timing seemed to be off.

 

My first post after the kids are back and I waffle like crazy.

Posted

This should set the default printer:

Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.SetDefaultPrinter "\\SERVER\PRINTER"

Posted
Network printers are generally a per user setting, it needs to be a logon script. You can make it a startup script if you enable GP Loopback but I've found this works intermittently at best.
Posted

You need to put it in both thom. In the startup script so the machine loads the drivers and then in the login script so the user gets the printers in her/his profiles.

 

Avoid loopback processing it complicates things and is unneeded in this situation.

Posted

Thanks Brad P & Norphy. I just got a student to test that in a classroom and it worked perfectly! I will just have to monitor it and see if it works in other rooms but it looks promising.

 

Just to recap the solution for others,

(following my guide on previous page)

13) I created a script called DefaultPrinterLibrary.vbs containing

Set objNetwork = WScript.CreateObject("WScript.Network")

objNetwork.SetDefaultPrinter "\\SERVER\Library-Laser"

14) I then Created a new GPO called "Printers - Library Default"

15) I added the script to the starup and logon sections in the GP Editor

16) I set the order of the GPO's in the Library OU to 1, Push client, 2, Push Printer 3, Library default

  • 2 years later...
Posted

Hi

 

Please can someone help. I am looking at using print management in windows 2003 r2. I have got it to deploy the printers to the machine under machine with no problems. Now I have to set the default print. I have a script that does it when I run it manually.

 

Set objNetwork = WScript.CreateObject("WScript.Network")

objNetwork.SetDefaultPrinter "\\print-server\HP4250"

 

But it does not set the the default.

 

I have set up a group policy to run the pushprinterconnections.exe

Then I set up a group policy to run and default printer set in the user and computer logon script.

 

This does not work. Have you any idea what I have done wrong or do I need a delay in the script as it is running too soon.

 

Thanks for all your help.

 

Richard

Posted

I'm sorry to hear so many of you are having R2 Print Management problems. I've always found this guide useful. I've deployed it to users, computers or a combination of both in quite a number of networks now.

 

The default printer is set alphabetically, so name your printers accordingly. As a recommendation, always use the latest printer drivers as some 'older' drivers can create problems.

Locally attached printers to workstations shouldn't be a problem. You can create additional print servers within the Print Management console. So long as you share it and set permissions correctly, it should behave the same as a network printer.

 

For simplicity, I always name printers and their sharenames the same, otherwise it can get complicated. I also give them proper names and you can safely ignore the MS-DOS compatibility warning when using spaces in your sharenames!

Posted (edited)

In a nutshell, you can't really set default printers. R2 print management will ensure the correct printer(s) are deployed to the appropriate user/group, but in a lot of cases the printer will still be installing anything upto 5 minutes after the user has logged on, so any startup/logon scripts probably wont see the printer hence why it's not being defaulted.

 

I havent looked at it yet but I think server 2008 client side preferences will allow you to set a default printer - but as it's per user only yo would need to use item targetting.

Edited by Oops_my_bad
Posted (edited)

Hi could I place a pause at the start of the logon script that sets the default printer or would that stop the machine.

 

Something like

WScript.sleep 300000

to pause for 5 minutes

 

Richard:rolleyes:

Edited by ricki
  • 6 months later...
Posted

Hi,

Sorry to drag up an old thread but I'm determined to find a solution!

We used to use policy maker for our printing needs but not that M$ own it there hasn't been updates for a good couple of years. And the final straw has come when some recent security updates have killed it!

 

I have setup print management in R2 which works quite well but the age old problem of setting the default printer remains but was something policy maker delt with.

We have Adobe Pro installed on most machines in the school which installed the printer driver as "Adobe PDF" that is the default on all machines its installed on.

 

I have tried running the script as shown in this thread and used Thom's points but still can't get the default to be one of the network printers I'm assigning. (per machine)

 

I have an OU for each computer room/ staff room and within there a GPO containing the deployed printers. As I understand it any settings put into the user configuration inside the GPO which is assigned to machines, will not apply to users logging into that room of computers as the users are in their own OU.

 

I understand why the script's are not setting the default printer as the printers don't appear until after 30secs or so as ricki has stated.

I have renamed the shared printer to aaLibraryBlack.

Also have considered renaming the Adobe PDF printer to xAdobe PDF printer but would cause issues if I choose to role back the software.

We have 2003 R2 domain controllers.

Any advice would be much appreciated, how do others deal with printing in schools?

 

Joe

Posted

The lack of default printer options is quite possibly the most brainless bit of design on server software I've come across - amazing that it's never had a patch or update (seems like the email notifications in the print management console have never worked either???)

 

My solution was to use a script that checks the OU of the workstation and uses an if statement to assign the right printers, should the OU not be mentioned it uses else to map a default printer. There's also an add-on I put in to map printers by security group e.g. if you restrict access to a colour printer etc.

 

Having moved all the printers onto GPO when we first got R2... then moved the lot back onto scripts again I'll be sticking with my VBS for a while longer :cool:

Posted

gshaw, thanks for your reply!

We used to use a batch script to connect to the local printers but ended up tatooing the printers onto the machines.

What you mind posting a copy of your vb script? Sounds like it might work quite well for us.

Posted (edited)

What you mind posting a copy of your vb script? Sounds like it might work quite well for us.

 

I've written a kix script which maps printers and sets defaults based upon the PC's group membership - it could easily be adapted to use the PC's OU, the PC Name or user's group membership. It reads the groups and printers from a separate .ini file so there's no code tweaking required when you want to make changes/additions. I can post it if you're interested.

Edited by Chad
typo
Posted
I've written a kix script which maps printers and sets defaults based upon the PC's group membership - it could easily be adapted to use the PC's OU, the PC Name or user's group membership. It reads the groups and printers from a separate .ini file so there's no code tweaking required when you want to make changes/additions. I can post it if you're interested.

 

Chad, yes if you could post the script I would really appreciate it!!! Not that advanced with scripting myself as I tend to get bogged down with other jobs!

 

Thanks

Posted (edited)

Here's my one with the optional colour printer by security group script at the end...

 

'*************************************
'Maps new printers based on current OU
'*************************************

dim printmsg

dim strUserName ' Current user

Set objNetwork = CreateObject("WScript.Network")
strUserName = objNetwork.UserName

Set objSysInfo = CreateObject("ADSystemInfo")
strName = objSysInfo.ComputerName

arrComputerName = Split(strName, ",")
arrOU = Split(arrComputerName(1), "=")
strComputerOU = arrOU(1)

'****************************************
'Map Department Printers from Computer OU
'****************************************

objNetwork.AddWindowsPrinterConnection "\\yourprintserver\alluserprinter1"

Select Case strComputerOU

   Case "OU1"
       objNetwork.AddWindowsPrinterConnection "\\yourprintserver\printer1"
       objNetwork.AddWindowsPrinterConnection "\\yourprintserver\printer2"
       objNetwork.SetDefaultPrinter "\\yourprintserver\grs-printer"
   Case "OU2"
       objNetwork.AddWindowsPrinterConnection "\\yourprintserver\printer3"
       objNetwork.AddWindowsPrinterConnection "\\yourprintserver\printer4"
       objNetwork.SetDefaultPrinter "\\yourprintserver\grs-printer3"
   Case Else
       objNetwork.SetDefaultPrinter "\\yourprintserver\genericprinter"

End Select

'************************************
'Map Colour Printer by Security Group
'************************************

on error resume next

strUserPath = "LDAP://" & objSysInfo.UserName
Set objUser = GetObject(strUserPath)

For Each strGroup in objUser.MemberOf
   strGroupPath = "LDAP://" & strGroup
   Set objGroup = GetObject(strGroupPath)
   strGroupName = objGroup.CN

Select Case strGroupName

   Case "ColourPrinter"
       printmsg = MsgBox("You now have access to the colour printer  ",64,"Printers")
objNetwork.AddWindowsPrinterConnection "\\yourprintserver\colourprinter"        

   End Select
Next

 

If you don't need the security group stuff remove the bottom section, if you want the group checker but not the mesasge remove the printmsg line :)

Edited by gshaw

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...