NeoNemesis Posted July 25, 2007 Posted July 25, 2007 Hi Guys, This is my first post here at EduGeek... I can't believe I have been able to survive without this resource for so long! Thanks for all of the help other threads have given me over the past few months. We are attempting to redesign our layout here and I have been put in charge of the print architecture. Here is my problem: As with any establishment such as this I have a number of buildings, floors and rooms to fit up. A requirement that has been handed to me from above is that we will be implementing "Line of Sight" printing, which means printers must be mapped to workstations based on their location. I was hoping to be able to do this with W2k3R2, having GPOs assigned to OUs that are based on the locational heirarchy (Bulding 1 > Floor 2 > Room 3 etc). R2 deploys printers absolutely perfectly. HOWEVER! Another requirement is that workstations are often reassigned to different rooms. R2 promised me that if I simply moved the workstation to the appropriate new OU (workstations are not moved often enough to warrent the bit being automated) it would drop the old printer mappings and add the new one(s). But - it doesnt, the whole thing screws up and gets me in a right pickle. (As Friez documents in here). What I need is a script that will give me this functionality - unfortunately I am not confident enough in scripting to even know where to start. - On computer start, clear print mappings - On computer start, query the AD for the OU that the workstation is in - Map the printer that is appropriate for the OU And hopefully this would solve the problem! I realise that this might sound a bit waffley so feel free to ask me any questions that would aid in clariffication. Thanks in advance, Jordan
leon Posted July 25, 2007 Posted July 25, 2007 Just make sure you drop all printers at the start of a script before adding one? Eg: rundll32 printui.dll,PrintUIEntry /dn /n \\printer_path\printer_name If you're going to apply the script thought policy then you won't need a query to discover in which OU the computer object resides.
mullet_man Posted July 25, 2007 Posted July 25, 2007 Check out Ric_'s printer script... http://edugeek.net/index.php?name=Forums&file=viewtopic&p=104925#104925 It is really easy to setup and maps printer via computer name. It sounds exactly what you need.
NeoNemesis Posted July 25, 2007 Author Posted July 25, 2007 Thanks Mullet, Another thing that I fogot to say was that computer names are not a useful identifier. They are all based on the asset tag of the machine which means nothing /sniff!
mullet_man Posted July 25, 2007 Posted July 25, 2007 There is also a printer script around here that assigns via the OU in Active Directory. Just search the forums for printer script
mullet_man Posted July 25, 2007 Posted July 25, 2007 Here you go, Check the script a few posts down http://edugeek.net/index.php?name=Forums&file=viewtopic&t=404&postdays=0&postorder=asc&start=45
rodsco Posted July 25, 2007 Posted July 25, 2007 We use R2 to deploy printer based on location exactly as you are trying to do. I wasnt aware of any issue in moving a machine from one OU to another until I read your post. So this afternoon I've put it to the test. Thankfully all works as its supposed too. Only the printers assigned to the particular OU are available, and ones from previous OU's are gone. The only slight confusion was that after moving the computer and rebooting the first print dialog box that appeared sometimes listed the printers from the previous OU only. Closing the dialog box and trying again gave the correct list.
snrweb Posted July 27, 2007 Posted July 27, 2007 Good old CON2PRT in the logon scipt that matches the printers to a variable set on the computer. It does the job.
maniac Posted July 27, 2007 Posted July 27, 2007 Look at this post http://www.edugeek.net/index.php?name=Forums&file=viewtopic&t=6370&highlight=maniac+printer About half way down is a VBS script I use for mapping printers based on active directory OU. Been using this for a year now, and it's been ultra reliable, and works a treat! I can't take credit for the script, I found it on a scripting site. With a slight modification you can run the same script at logoff to remove the printer connections. This can be useful if you use roaming profiles to stop the printers being saved to the profile. Cheers, Mike.
TimH Posted August 4, 2007 Posted August 4, 2007 Rather than relying on PC names and tables of rooms, I've had ours using the AD "Location" property. Logon script reads workstation location then finds in AD the printer with matching location. It means you don't have to be so careful with workstation names and can quickly redirect to another printer. Staff get the local printer mapped first, then all others mapped (because it takes quite a while at logon), kids just get the single printer. We have a default "blackhole" printer as a sink for circumstances where there is no printer/someone forgets to set a location.
Ric_ Posted August 6, 2007 Posted August 6, 2007 The wiki is also a good source of information http://edugeekwiki.rm-charlton.net/index.php/Scripting_Printer_Addition_Based_on_Location
plock Posted August 6, 2007 Posted August 6, 2007 I have a script that will do exactly what you want. It's our current setup. You will need to modify it for your domain, your OU's and so forth. See the script attached your need to download and rename the extension to .vbs. Good luck!printerconnect.txt
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now