Solved

Windows 2003/2008 Terminal Services and Printers

Posted on 2011-03-24
5
669 Views
Last Modified: 2012-06-21
I have several terminal servers with a ton of users.  Each user has printers installed under their accounts pointing to network printers some read xxxPrinterxxx on {servername}.  Some are printers that were installed for the user looking like a local printer IP printer.  These printers obviously only show up under each users accounts.  What I have done is add all of our printers directly to the server which is hosting the Terminal Services.  The way I understand it is that the printers under the user accounts are called Client Printers and the printers I installed on the server directly are called SERVER PRINTERS.  Here is what I need to do.  I have already written into the login script to simply set the DEFAULT printer for each user to point to one of the SERVER printers, but I want to remove all of the printers installed under the users accounts so that the onyl printers they see are the SERVER printers.  Does anyone know how I would do that.  I had a script that eliminated true network printers that contained "\\" in the name but that obviously does not work for local client printers.  I am using VBS scripting as my login script can anyone give me a hand with how to remove these unwanted printers?

Thanks.
0
Comment
Question by:Steve Groner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 17

Expert Comment

by:Spike99
ID: 35209515
The easiest way to prevent the local printers from showing up on the terminal server is to use Terminal Services Configuration.

To do that in 2003:
1.  Click on Start > All Programs > Administrative Tools
2.  Click on Terminal Services Configuration
3.  Double-click on the connection type (either RDP-TCP or ICA-TCP for citrix)
4.  Click on the Client Settings tab
5.  Under the "Disable the following" section at the bottom, check off the option for "Windows Printer Mapping"
6.  If you also want to disable LPT or COM port mapping for printers, check those options as well
7.  Click OK & then exit TS Config  to implement the change.

The options are a bit different in 2008:
1.  Click on Start > All Programs > Administrative Tools > Terminal Services
2.  Click on Terminal Services Configuration
3.  Double-click on the connection type (either RDP-TCP or ICA-TCP for citrix)
4.  Click on the Client Settings tab
5.  Under the "Disable the following" section at the bottom, check off the option for "Windows Printer"
6.  If you also want to disable LPT or COM port mapping for printers, check those options as well
7.  Click OK & then exit TS Config to implement the change.

This would have to repeated on every terminal server since this is a local setting.  I don't believe it's it's possible to restrict this in a GPO.  This change won't effect any users currently logged on to the system: they will see the change the next time they log on.

But, this won't remove the printers from their local systems: it will just remove the printers from their remote session on the TS.

If you want to remove the local printers from the PCs, there are VBS scripts and command line tools you can use to do that.

Alicia
0
 
LVL 1

Author Comment

by:Steve Groner
ID: 35209699
Thanks but wrong printers.  Those I know how to get rid of I am referring to printers, that are installed "IN SESSION" on a terminal server.  User Logs in, clicks on Add Printer -->  etc.....  these printers only show up for that user and are added to the list of SERVER printers that are installed locally on the server.  The printers that were added during the USER's session are the printers I am trying to get rid of.

But thanks for replying.
0
 
LVL 17

Accepted Solution

by:
Spike99 earned 125 total points
ID: 35209850
I would deny users rights to create printers by using a GPO.  Then, I think you can remove those printers by deleting the values in the one or more of the subkeys in HKCU\Printers (Connections or devmodeperuser or devmodes2).

Or, to get rid of all those: it is safe to delete the entire HKCU\Printers key:  we had to do that to remove old printers from users profiles before on our servers (we used a VBS script to remove the subkeys and then the key itself)

 
Const HKEY_CURRENT_USER = &H80000001 

strComputer = "."
strKeyPath = "Printers" 

Set objRegistry = GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv") 

DeleteSubkeys HKEY_CURRENT_USER, strKeypath 

Sub DeleteSubkeys(HKEY_CURRENT_USER, strKeyPath) 
objRegistry.EnumKey HKEY_CURRENT_USER, strKeyPath, arrSubkeys 

If IsArray(arrSubkeys) Then 
For Each strSubkey In arrSubkeys 
DeleteSubkeys HKEY_CURRENT_USER, strKeyPath & "\" & strSubkey 
Next 
End If 

objRegistry.DeleteKey HKEY_CURRENT_USER, strKeyPath
End Sub

Open in new window


Alicia
0
 
LVL 1

Author Closing Comment

by:Steve Groner
ID: 35210590
That is the solution I needed.  Thank you very much.
0
 
LVL 17

Expert Comment

by:Spike99
ID: 35210615
I'm glad I could help!

Sorry, I misunderstood what you were asking about at first: I thought you wanted to get rid of redirected printers.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question