Solved

Map and dismount printer connections

Posted on 2009-07-15
4
645 Views
Last Modified: 2012-05-07
Hello.
I have Server 2008 Server with printer role installed. I can configure the printer connections for Servers and Vista. But I have a lot of Windows XP computers, so I need to set the printers for them, I also need to remove the exist printer connections.

I tried so: RUNDLL32 PRINTUI.DLL,PrintUIEntry /gd /c\\machine /n\\machine\printer
It does not work.

Please help.
0
Comment
Question by:Master-Squirrel
  • 2
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
John_Miller earned 250 total points
ID: 24860382
Take a look at the code listed below...substitute your printer server name and share accordingly.


'Add a Printer
 

Set WshNetwork = CreateObject("WScript.Network")
 

WshNetwork.AddWindowsPrinterConnection "\\PrintServer1\Xerox300"

WshNetwork.SetDefaultPrinter "\\PrintServer1\Xerox300"
 

' Delete a Printer Connection
 

Set objNetwork = WScript.CreateObject("WScript.Network")

objNetwork.RemovePrinterConnection "\\PrintServer\xerox3006"

Open in new window

0
 

Author Comment

by:Master-Squirrel
ID: 24866683
Yes, it works. I mark this question as answered after you say to me does it work with Vista and Server 2008?
0
 
LVL 1

Expert Comment

by:John_Miller
ID: 24868596
Yes, these work with one exception. They will not work if you have a desktop (Vista or XP) running 64-bit and you have not loaded the 64-bit drivers onto the print server.
0
 

Author Comment

by:Master-Squirrel
ID: 24895169
Thanks for you help.
0

Featured Post

Free book by J.Peter Bruzzese, Microsoft MVP

Are you using Office 365? Trying to set up email signatures but you’re struggling with transport rules and connectors? Let renowned Microsoft MVP J.Peter Bruzzese show you how in this exclusive e-book on Office 365 email signatures. Better yet, it’s free!

Join & Write a Comment

A procedure for exporting installed hotfix details of remote computers using powershell
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

747 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

11 Experts available now in Live!

Get 1:1 Help Now