Solved

Map and dismount printer connections

Posted on 2009-07-15
4
647 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. 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

We recently had an issue where out of nowhere, end users started indicating that their logins to our terminal server were just showing a "blank screen." After checking the usual suspects -- profiles, shell=explorer.exe in the registry, userinit.exe,…
If you migrate a Terminal Server licenses server inside the 2008 server family, you can takte advantage of the build-in migration tool. If you like to migrate an older 2003 Server (and the installed client CALs) to a 2008 R2 server for example, you …
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

809 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