[Last Call] Learn how to a build a cloud-first strategyRegister Now


Removing User Printers on a Terminal Server in Mass

Posted on 2011-05-12
Medium Priority
Last Modified: 2012-05-11
Is there a way to clean up user defined printers on a terminal server?

Let me give you an example of what I have run across.

User 1 has logged onto the terminal server.
User 1 then  created a printer and gave it the name MYPRINTER, he used the IP address to connect.  This printer is located in the office.
The terminal server already has a printer named "OFFICE 1".  It is not shared, it is an IP printer. It is the one located in the office.

Now I have each user with a different printer name for the same system printer.

This creates confusion.  As well, when OFFICE 1 goes down,  I simple re-point the server printer OFFICE 1  to another IP of a printer that is working, OFFICE 2.  However,  those users with custom printers names for the same printer complain because their  print jobs continue to go to the dead printer.  

I want to clean up this mess by forcing  everyone to use the same printer name .

What is the best way to
1) Remove all the custom (user setup) print names.  I would like to do this without having to go to each users log-on.
2) Make available to everyone's printer selection list the core group of printers they need.

Question by:HCSHAW
  • 2
  • 2
LVL 66

Expert Comment

ID: 35751173
How  about a login script to wipe the subkeys under the following?


Could even run a script to mount all the user profiles and then wipe that key....

There are a handful of other values under "HKEY_CURRENT_USER\Printers\Settings" for network printers, but they are just remnants....

LVL 10

Accepted Solution

David_Ingledew earned 2000 total points
ID: 35752884
As you don't know the printer names you'll need to run this via a VB script to lookup the printers locally installed.

Then you can use Printui to add the correct network printers.

See this one: http://www.experts-exchange.com/Programming/Misc/Q_20908993.html?sfQueryTermInfo=1+10+30+printui+vb

Author Comment

ID: 35754655
Good information.   I need to add back a printer to ALL USERS that was deleted yesterday.  The PRINTUI.DLL seems to be the way to go, but I have not had and success getting it to show up on all users available printers.  What am I doing wrong?

C:\WINDOWS>rundll32 printui.dll,PrintUIEntry /ga /c\\ala-trmsrvr /n\\Ala-Sxe\DReport1

ala-trmsvr is the Terminal server that all users needs to have the printer show up on.   The printer is actually defined on ALA-SXE and is shared out.    The printer is currently showing up under ADMINISTRATOR since I orginally added them for checking the printers from one server.

Running the command reports no errors.

Hoping on a users session that is already logged in, I do not see the printer appear in their selection list.

Any idea as to what is happening?   I can't find any logs to do some trouble shooting.

LVL 10

Expert Comment

ID: 35754794
It doesn't log unless set to if i remember right
Let me check my scripts....

OK, use /in instead of /ga (/ga require administrative rights from what I can see.)

C:\WINDOWS>rundll32 printui.dll,PrintUIEntry /ga /c\\ala-trmsrvr /n\\Ala-Sxe\DReport1
C:\WINDOWS>rundll32 printui.dll,PrintUIEntry /in /n\\Ala-Sxe\DReport1

Author Closing Comment

ID: 35755195
It seems like I have everything I need to do the clean up.   Thanks for all the suggestions and examples.

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

How to solve seemingly unsolvable printer issues. Users sometimes run into printing issues where all the normal steps do not seem to work. Well the steps below can show users how to take one extra step beyond the normal steps needed to remove old…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

834 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