• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 656
  • Last Modified:

Map and dismount printer connections

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
Master-Squirrel
Asked:
Master-Squirrel
  • 2
  • 2
1 Solution
 
John_MillerCommented:
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
 
Master-SquirrelAuthor Commented:
Yes, it works. I mark this question as answered after you say to me does it work with Vista and Server 2008?
0
 
John_MillerCommented:
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
 
Master-SquirrelAuthor Commented:
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

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now