Remove Old Mapped Printers via GPO/Script/Something?

S

Scott Townsend

We've migrated our Print Server a Few times and now we have several legasy
printers mapped to user sessions.

The Printers were connected by just double clicking the Printer Share on the
Server by the User. So not pushed by GPO.

We are now pushing out the New Printers to the users via GPO.

Besides having the Users go and Delete the Printers out of the Printer's
Control Panel, how can I delete them??

It would be great if there was a Script, GPO, or something that I could run
when the user logs in and have it remove all of the old printers.

I've tried running these Manually for users and myself.

rundll32 printui.dll,PrintUIEntry /q /dn /n\\server\HBG-Crayola
rundll32 printui.dll,PrintUIEntry /q /gd /n\\server\HBG-Crayola

Though It looks like it needs a connection to the Print Server to remove the
Connection?
The Shared Printers on the Old server no longer Exist. So there is no
connection to them.


if I run rundll32 printui.dll,PrintUIEntry /ge
It says there are no per-machine printers installed.

Do I have to Reboot the server for them to disappear for the other users
(which have logged off and back on)



Thanks,
 
M

Morgan che

Hi,

Thanks for using this newsgroup.

From your description, I understand you want to delete the legacy shared
printer. You have tried to manually remove it from Pinter Control Panel and
use 'Rundll32' command. However, these methods couldn't reach your goal. So
you hope other methods to delete the legacy print from the workstations. If
I misunderstand, please let me know.

Firstly, from my test, even through the client can't connect to Printer
server, the printers on client can still be deleted. So you don't worry
about that if old printer server no longer exists, we are unable to delete
the shared printers on client.

Suggestion:
=======

Based on my research, the shared printer has registered in local registry.
These registries may be occupied by other services, applications or
process. So sometimes, we couldn't simply delete the shared print through
command line or Pinter Control Panel. I would like to suggest deleting
related registries firstly to test the result.

Note: Please understand that this method is related to the operation of
registry, and may lead to the serious problems. Please ensure that you do
appropriate backup before you modify any registry key and test the method
in your lab environment first.

Delete the following registry under:
KEY_CURRENT_USER\Printers\Connections\<Printer>
Please replace <Printer> with the actual printer that you want to delete.

Restart Print Spooler service, and then delete the shared Pinter on Pinter
Control panel to test the result.

I hope this helps. If this method doesn't work either or anything is
unclear, please feel free to post back.

Thanks.


Sincerely
Morgan Che
Microsoft Online Support
Microsoft Global Technical Support Center

Get Secure! - www.microsoft.com/security
=====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
From: "Scott Townsend" <[email protected]>
Subject: Remove Old Mapped Printers via GPO/Script/Something?
Date: Thu, 10 Apr 2008 11:13:13 -0700
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.3959
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133
Message-ID: <#[email protected]>
Newsgroups:
microsoft.public.win2000.printing,microsoft.public.windows.server.general
NNTP-Posting-Host: 204-145-245-183.enm.com 204.145.245.183
Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP02.phx.gbl
Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.windows.server.general:36113
microsoft.public.win2000.printing:465
X-Tomcat-NG: microsoft.public.win2000.printing

We've migrated our Print Server a Few times and now we have several legasy
printers mapped to user sessions.

The Printers were connected by just double clicking the Printer Share on
the
Server by the User. So not pushed by GPO.

We are now pushing out the New Printers to the users via GPO.

Besides having the Users go and Delete the Printers out of the Printer's
Control Panel, how can I delete them??

It would be great if there was a Script, GPO, or something that I could run
when the user logs in and have it remove all of the old printers.

I've tried running these Manually for users and myself.

rundll32 printui.dll,PrintUIEntry /q /dn /n\\server\HBG-Crayola
rundll32 printui.dll,PrintUIEntry /q /gd /n\\server\HBG-Crayola

Though It looks like it needs a connection to the Print Server to remove
the
Connection?
The Shared Printers on the Old server no longer Exist. So there is no
connection to them.


if I run rundll32 printui.dll,PrintUIEntry /ge
It says there are no per-machine printers installed.

Do I have to Reboot the server for them to disappear for the other users
(which have logged off and back on)



Thanks,
 
S

Scott Townsend

The machine that the Printers are on is a Locked Down Terminal Server. The
users do not have Access to the Registry. When I run the delete printui.dll
commands as the user, it tells me that Access is Denied.



If I run the Registry file with the -Keyname in the Login Script, it says
that registry editing is prohibited.



Is there a way to force the deletion in HKCU via GPO?



Thanks,

Scott<-
 
A

Alan Morris [MSFT]

for XP and greater clients you can use the WMI scripts in system32
(system32\Printing_admin_Scripts\EN-US in Vista)


E:\>prnmngr -d -p "\\OLDSERVER\OLD printer"
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Deleted printer "\\OLDSERVER\OLD printer"


The post is in the Win2k group so I assume the Win2k is in this mix
somewhere

--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/search/?adv=1

This posting is provided "AS IS" with no warranties, and confers no rights.
 
M

Morgan che

Hi,

Thanks for posting back.

From your reply, I understand the you want script to delete the
corresponding registry values properly. But the problem is that the access
to Registry Editor is blocked by group policy. So I suggest disabling the
block Registry Editor access group policy temporarily. After all the
printers are deleted by logon script, we can then re-enable the group
policy.

To disable the block registry policy, please open gpedit tool ( Start >>
Run >> "gpedit.msc" ), navigate to User Configuration >> Administrative
Templates >> System, and on the right side double click "Prevent Access To
Registry Editing Tools" to Select Disable option.

I hope this helps.

Sincerely
Morgan Che
Microsoft Online Support
Microsoft Global Technical Support Center

Get Secure! - www.microsoft.com/security
=====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
From: "Scott Townsend" <[email protected]>
References: <#[email protected]>
<uiWmQ#[email protected]>
Subject: Re: Remove Old Mapped Printers via GPO/Script/Something?
Date: Mon, 14 Apr 2008 12:26:00 -0700
Lines: 143
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.3959
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133
Message-ID: <##[email protected]>
Newsgroups: microsoft.public.win2000.printing
NNTP-Posting-Host: 204-145-245-202.enm.com 204.145.245.202
Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP05.phx.gbl
Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.win2000.printing:468
X-Tomcat-NG: microsoft.public.win2000.printing

The machine that the Printers are on is a Locked Down Terminal Server. The
users do not have Access to the Registry. When I run the delete printui.dll
commands as the user, it tells me that Access is Denied.



If I run the Registry file with the -Keyname in the Login Script, it says
that registry editing is prohibited.



Is there a way to force the deletion in HKCU via GPO?



Thanks,

Scott<-
 
S

Scott Townsend

I extracted all of the HKU Keys for all of the users on one of the Terminal
Servers, then populated an excel spreadsheet with all of the old printer
names (not knowing who had what installed) and had excel populate the
[-HKEY_USER-######\Printers\Connections\,,<printer>] strings.

547 lines later I just ran the reg file myself.

Is the HKU entry (i.e.
HKEY_USERS\S-1-6-21-2438577724-883948833-358851572-500) the same from
machine to machine? The Number is the User's SID?

I have 2 Terminal Servers that I need to get this done on.

The standalone laptops/desktop users all have local Admin Rights so I can
just run the standard loginscript to import reg keys for HKCU
[-HKEY_CURRENT_USER \Printers\Connections\,,<printer>]

Thanks,
 
M

Morgan che

Hi,

Thanks for the reply.

I am glad to hear we are making progress.

<< Is the HKU entry (i.e.
HKEY_USERS\S-1-6-21-2438577724-883948833-358851572-500) the same from
machine to machine? The Number is the User's SID?>>

Yes, this number is user's SID. Furthermore, from the SID structure, I
conclude that this is administrator's SID. For more information about
well-known SID, please refer to the below article:

243330 Well-known security identifiers in Windows operating systems
http://support.microsoft.com/default.aspx?scid=kb;EN-US;243330

Also, if you have solved this issue, please kindly inform me. Otherwise, I
will follow up in couple of day to check the status.

Have a good day!


Sincerely
Morgan Che
Microsoft Online Support
Microsoft Global Technical Support Center

Get Secure! - www.microsoft.com/security
=====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
From: "Scott Townsend" <[email protected]>
References: <#[email protected]>
<uiWmQ#[email protected]>
<##[email protected]>
<[email protected]>
Subject: Re: Remove Old Mapped Printers via GPO/Script/Something?
Date: Tue, 15 Apr 2008 07:49:56 -0700
Lines: 224
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.3959
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133
Message-ID: <[email protected]>
Newsgroups: microsoft.public.win2000.printing
NNTP-Posting-Host: 204-145-245-219.enm.com 204.145.245.219
Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP02.phx.gbl
Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.win2000.printing:471
X-Tomcat-NG: microsoft.public.win2000.printing

I extracted all of the HKU Keys for all of the users on one of the Terminal
Servers, then populated an excel spreadsheet with all of the old printer
names (not knowing who had what installed) and had excel populate the
[-HKEY_USER-######\Printers\Connections\,,<printer>] strings.

547 lines later I just ran the reg file myself.

Is the HKU entry (i.e.
HKEY_USERS\S-1-6-21-2438577724-883948833-358851572-500) the same from
machine to machine? The Number is the User's SID?

I have 2 Terminal Servers that I need to get this done on.

The standalone laptops/desktop users all have local Admin Rights so I can
just run the standard loginscript to import reg keys for HKCU
[-HKEY_CURRENT_USER \Printers\Connections\,,<printer>]

Thanks,
 
M

Morgan che

Hi,

How are you?

I am writing to see if you have any update about this post. If you
encounter any break/fix issue or solve this issue, please feel free to let
me know.

Have a good day!
Sincerely
Morgan Che
Microsoft Online Support
Microsoft Global Technical Support Center

Get Secure! - www.microsoft.com/security
=====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
From: "Scott Townsend" <[email protected]>
Subject: Remove Old Mapped Printers via GPO/Script/Something?
Date: Thu, 10 Apr 2008 11:13:13 -0700
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.3959
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133
Message-ID: <#[email protected]>
Newsgroups:
microsoft.public.win2000.printing,microsoft.public.windows.server.general
NNTP-Posting-Host: 204-145-245-183.enm.com 204.145.245.183
Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP02.phx.gbl
Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.windows.server.general:36113
microsoft.public.win2000.printing:465
X-Tomcat-NG: microsoft.public.win2000.printing

We've migrated our Print Server a Few times and now we have several legasy
printers mapped to user sessions.

The Printers were connected by just double clicking the Printer Share on
the
Server by the User. So not pushed by GPO.

We are now pushing out the New Printers to the users via GPO.

Besides having the Users go and Delete the Printers out of the Printer's
Control Panel, how can I delete them??

It would be great if there was a Script, GPO, or something that I could run
when the user logs in and have it remove all of the old printers.

I've tried running these Manually for users and myself.

rundll32 printui.dll,PrintUIEntry /q /dn /n\\server\HBG-Crayola
rundll32 printui.dll,PrintUIEntry /q /gd /n\\server\HBG-Crayola

Though It looks like it needs a connection to the Print Server to remove
the
Connection?
The Shared Printers on the Old server no longer Exist. So there is no
connection to them.


if I run rundll32 printui.dll,PrintUIEntry /ge
It says there are no per-machine printers installed.

Do I have to Reboot the server for them to disappear for the other users
(which have logged off and back on)



Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top