Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Remove or change shared TCP/IP printer on W2k server

Posted on 2006-06-28
4
Medium Priority
?
240 Views
Last Modified: 2012-08-14
I have a printer shared and listed in Active Directory on my Windows 2000 server.  I need to change the printer name and / or share name but would like to have the clients currently connected to the printer automatically update to the new printer info and keep their connection.

My experience in the past is that this kind of change will cause the clients to retain a listing of the printer with its old info and show it as "unavailable" or "unable to connect".  Also, some clients will have the new printer automatically added, while others will not.  There are no group policy settings that I have set that should be creating these differences.
0
Comment
Question by:jbeach3
[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
  • 2
  • 2
4 Comments
 
LVL 13

Expert Comment

by:prashsax
ID: 17001801
Yes, if you change the share name of the printer, the old connection on client machines will not work.

You can use a logon script to install the new printer on client machine.

----------------------------------------------------------------------------------------------
Option Explicit
Dim objNetwork, strUNCPrinter
strUNCPrinter = "\\SERVER_NAME\PRINTER_NAME"
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strUNCPrinter

' Here is where we set the default printer to strUNCPrinter
objNetwork.SetDefaultPrinter strUNCPrinter
WScript.Echo "Check the Printers folder for : " & strUNCPrinter

WScript.Quit
-----------------------------------------------------------------------------------------------

Just copy and paste it into a file and name it "printlogon.vbs".
Change SERVER_NAME with the name of server where printer is shared.
Change PRINTER_NAME with the shared printer name.

Then use a group policy to run this script at user logon.

All, users will install the new printer and set to default automatically when they login.


0
 

Author Comment

by:jbeach3
ID: 17001887
What about the old printer?  Is there a way to remove it from all clients other than manually visiting each workstation?

My experience is that publishing a printer through AD is an easier way to propogate it to all clients.  Is the above code mainly to make the new printer the default printer?
0
 
LVL 13

Accepted Solution

by:
prashsax earned 1500 total points
ID: 17001941
Ok here is the new script.

First test this on a PC by running it manually.

--------------------------------------------------------------------------------
'''''''''''''''''''''''''''''This section adds new Printer
Option Explicit
Dim objNetwork, strUNCPrinter
strUNCPrinter = "\\SERVER_NAME\PRINTER_NAME"
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strUNCPrinter

'''''''''''''''''''''''''''' Here is where we set the default printer to strUNCPrinter
objNetwork.SetDefaultPrinter strUNCPrinter

'''''''''''''This section deletes old Printer
Dim RobjNetwork, RstrUNCPrinter, RbForce, RbUpdateProfile
RstrUNCPrinter = "\\OLD_SERVER_NAME\OLD_PRINTER_NAME"
RbForce = "True"
RbUpdateProfile = "False"
Set RobjNetwork = CreateObject("WScript.Network")
''''''''''''''' Section which removes the network printer
RobjNetwork.RemovePrinterConnection strUNCPrinter, bForce, bUpdateProfile
Wscript.Quit
----------------------------------------------------------------------------------------------

0
 

Author Comment

by:jbeach3
ID: 17003537
Your script seems like it will progromatically do what I'm looking to accomplish.  I was hoping that there was something within the Active Directory functionality which would automatically purge printers once they had been removed from the AD printqueue list.  It would seem that's not possible, though.  Thanks for your help...
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

FIPS stands for the Federal Information Processing Standardisation and FIPS 140-2 is a collection of standards that are generically associated with hardware and software cryptography. In most cases, people can refer to this as the method of encrypti…
This is the first one of a series of articles I’ll be writing to address technical issues that are always referred to as network problems. The network boundaries have changed, therefore having an understanding of how each piece in the network  puzzl…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

722 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