Solved

Need a login script that will delete certain print queues

Posted on 2008-06-20
16
307 Views
Last Modified: 2013-12-15
Hi Experts!  Here is the situation.  I have a client that has 15 users.  10 out of the 15 use different computers and when they do, they need printers mapped.  I figured no big deal when I signed up to support them but after doing the initial audit, they have printers shared on a few desktops, some shared on the server and a couple others that are local.  A huge mess since no one knows where they are printing when they sit at a different desk.  

I installed USB/NIC adapters and moved the printers that were being shared on the desktops to now be shared on the server.  I changed the other printers that were already on the server so that the naming scheme was consistent.  Here is my problem:

Some of the user profiles on several computers have printers listed that used to be shared by a desktop.  Since that setup doesn't exist, they are getting confused when the login script runs and they see two sets of printers.  I need to add to my login script a way to delete certain printer mappings that may already exist.  I can add the queue name but I don't know what the command is.

You are my only hope.....  : )   Thanks for any assistance you can offer up.  By the way, I know almost nothing on vbscript so if you offer something up that uses that, please be detailed.  
0
Comment
Question by:samiam41
  • 8
  • 7
16 Comments
 
LVL 5

Expert Comment

by:virtuatech
ID: 21833536
0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 21833538
Call prnmngr.vbs from your script.
cscript.exe prnmngr.vbs -d Printername

http://technet2.microsoft.com/windowsserver/en/library/1b6a1588-17f3-48a0-80e9-f52fb65ba21d1033.mspx?mfr=true
0
 
LVL 9

Author Comment

by:samiam41
ID: 21945270
Sorry gents.  Vacation and traveling took its toll on my time.  I apologize for not getting back to this sooner.

Virtuatech > Thanks for the post.  I see that the question was abandonded and the answer was forced.  Have you tried the solution given?  I don't want to wipe out all queue's, just certain ones.  Not sure how to modify the script to exclude the queue's I want to keep.  Any idea?

Kenneniah > Thanks for the post.  I reviewed that technet article before but didn't have any idea how to put together the commands.  I don't work with scripting enough to be able to do that.  If you can put something together, I would gladly test it.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 9

Author Comment

by:samiam41
ID: 22003136
Any new suggestions?
0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 22025176
You don't have to do any scripting. Just use the command line.

cscript.exe prnmngr.vbs -d Printername

Printername is the printer you want to delete, not much to it. So if a printer you wanted deleted was "HP Deskjet" you'd run...

cscript.exe prnmngr.vbs -d "HP Deskjet"
0
 
LVL 9

Author Comment

by:samiam41
ID: 22025206
Oh....  I get it now.  Do the clients need to have that program on their computer to run?  If so, where should I put it.  Thanks for the help.
0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 22025248
Nope, they are included with XP Professional. Sometimes you might need the full path however, so just to make sure I'd probably make it....
cscript.exe %systemroot%\system32\prnmngr.vbs -d Printername
0
 
LVL 9

Author Comment

by:samiam41
ID: 22025275
Outstanding!  That is perfect!  Thanks for the help.
0
 
LVL 24

Accepted Solution

by:
Kenneniah earned 500 total points
ID: 22025277
Opps, I forgot the -p    :)
cscript.exe %systemroot%\system32\prnmngr.vbs -d -p Printername

Another option if you want to start from scratch at each login is a simple....
cscript.exe %systemroot%\system32\prnmngr.vbs -x
That will delete all printers, so only those you reconnect later in the logon script will exist.
0
 
LVL 9

Author Comment

by:samiam41
ID: 22025320
Even better!!  Man I am glad to have a solution for this.  I will test it out this weekend and post back any problems with it.  Thanks again for all of your help and patience!
0
 
LVL 9

Author Closing Comment

by:samiam41
ID: 31469263
Thanks again!  I'm pretty confident this will work so I am going to accept the solution now and just post back any questions should any come up in the testing this weekend.  Great work!  Take care!

Regards,
Aaron
0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 22025488
No problem :)
The way I would probably do it is to use the wipe clean method, then add the printers I want them to have in the logon script as well. It would look something like ....

cscript.exe %systemroot%\system32\prnmngr.vbs -x
cscript.exe %systemroot%\system32\prnmngr.vbs -ac -p "\\server\printshare1"
cscript.exe %systemroot%\system32\prnmngr.vbs -ac -p "\\server\printshare2"
etc.
etc.
0
 
LVL 9

Author Comment

by:samiam41
ID: 22025511
They have a PDF creator listed as a printer.  How should that be handled?  I thought about just listing the printers to be deleted rather than trying to add that printer back.
0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 22025889
Hmm, yeah it can be a pain to correctly add some PDF printers through a logon script. In the long run it'll depend on how many printers you actually have to delete. If not too many, it won't take that long to make a line in the logon script for each that you want to remove.
0
 
LVL 9

Author Comment

by:samiam41
ID: 22025912
Cool.  That was what I was thinking.  Just mark out the 4 or 5 printers that I want deleted and then add the correct ones in.  I will leave that PDF printer alone.  I have another client with a similar issue but doesn't have any of the PDF printers that this client does.  You can bet that I will be adding your scripting to their login script.  Wahoo!  Thanks again for all of your help.  If I have any follow up questions, I will let you know.  Take care!
0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 22025989
Sure thing, I'll be around so if you have any questions I'll try to get back ASAP :)
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

810 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