Removing User Printers on a Terminal Server in Mass

Posted on 2011-05-12
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
    LVL 66

    Expert Comment

    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

    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:

    Author Comment

    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

    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

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    This seems to be a very common error related to the Samsung printer driver. First, this is the error we're talking about: Log: System Type: Error Event: 7000 Agent Time: 3:37:24 am 22-Apr-09 Event Time: 6:07:24 pm 21-Apr-09 UTC Source: Se…
    ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now