Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Map and dismount printer connections

Posted on 2009-07-15
4
Medium Priority
?
654 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 1000 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

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

Redirected folders in a windows domain can be quite useful for a number of reasons, one of them being that with redirected application data, you can give users more seamless experience when logging into different workstations.  For example, if a use…
Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…

885 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