Managing Printers in a Remote Desktop Environment
by , 15th November 2011 at 03:00 PM (3036 Views)
Introduction
So, regular readers of my blog will know that we run quite an extensive Remote Desktop Environment at my new School. This poses for some interesting issues when dealing with printing - so a rethink on the traditional methods was needed.
Traditional Printer Scripting
Lets start at the beginning - with the "old-school" method of printer mappings. Usually, this was achieved with a good old-fashioned batch script, ala Drive Mappings. Not content with batch anymore - I moved this on to VBS for speed. Ive attached my main script to this post for a nosey; but below is an except...
This does as it says really. It compares the first 6 characters of the machine name (retrieved and stored in a variable earlier in the script) to a specified statement. When it matches, it runs that section. See the full script for more (the logoff one in there too) - it is well commented!Code:Add printer connections dependant upon location Select Case (Left(computerName, 6)) Case "******" WshNetwork.AddWindowsPrinterConnection "\\PRINTSERVERNAME\PRINTERSHARE" WshNetwork.SetDefaultPrinter "\\PRINTSERVERNAME\PRINTERSHARE"
WorkstationPrintersLogoff.vbs
WorkstationPrinters.vbs
This works fine for normal workstations - where it runs as a logon script. There is also a partner logoff script which clears the connections to stop them following the user around. The last thing we need is Student 1 printing in IT2 when they are in IT1 - just because they have been in IT2 last lesson.
So, what about Remote Desktop Services
But - this wont work with RDS - as the machine is resolved as the server, and there could be multiple locations with different printers. In our case, there definately are. Our Thin Client (RDS) environment is made up of two types of machine. We have repurposed hardware running Windows Thin PC (Windows 7 extra light!), and Wyse T50 terminals running their "HomeBrew" linux.
The Thin PC ones use a similar script setup to the conventional PCs. The only difference is that the printers are added on startup - since the shell for the Thin PCs has been altered to load VBS and RDP session. More on that will follow in another post - but it is touched on slightly in my SCCM posts from Summer: http://www.edugeek.net/blogs/thescar...eployment.html
The RDP session is set to carry thought client printers (there is a custom RDP connection file used on all of the Thin PCs) - so they get the printer for their room and no others. The ability to add and remove printer has also been removed across the site. Well, there is no point putting the effort into setting the printers is people can monkey with them!
Non-Windows Remote Desktop Connections
Next then, the Wyse terminals. More problematic, as they wouldnt understand any of the scripts or GPOs. Instead, some clever GPO and OU layout - and use of the GPO Mode "Replace" to set user properties for the RDP session were used. You can see my structure here...
The "TS" after the GPO name is the magic. These two GPOs have extra settings to push printer connections for the RDP sessions. Problem number two - how to work out what machines get what printers, or you just have all of them and users select theirs. Messy - very messy. Instead - group your users around printers - which they need, defaults etc. We created AD groups and put staff into these groups depending which they needed. Then, used Group Policy Preferences (not Deployed Printers) to set them. Preferences allows you to do item level targetting so only people in the AD group specified get the printer. Here is an except...
Here is the actual GPO editor - so you can see we have lots of printers and lots of targetted printers. We also use this to set the defaults for different groups. You can see we also use a "Delete All" to stop them collecting printers.
Job done... :-)
Happy GPO Admin
As always, questions, comments always welcome. Post here or PM me if you want to know more.







Email Blog Entry
