Is there a way to remotely add printers without resorting to an RDC?

MaxDSP

Lifer
May 15, 2001
10,056
0
71
I'm having to connect people manually to the print server after they login, but aside from logon batch files that add the printers, is there another route I can take to add printers from my workstation? Right now, I usually Dameware or RDC in to the other desktops and add the printers.
 

Rapidskies

Golden Member
May 27, 2003
1,165
0
0
Scripts would be the way to go, here is a sample one I use for a partner of ours that creates printers:

Add Printer Script
'Creates TCPIP ports, adds driver, then creates printer.
'

'Set script environment
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

'Added next 2 lines for Win2003 was getting access denied before
objWMIService.Security_.Privileges. _
AddAsString "SeLoadDriverPrivilege", True


'This section creates TCPIP Ports
Set objNewPort = objWMIService.Get ("Win32_TCPIPPrinterPort").SpawnInstance_

objNewPort.Name = "IP_192.168.100.200"
objNewPort.Protocol = 1
objNewPort.HostAddress = "192.168.100.200"
objNewPort.PortNumber = "9100"
objNewPort.SNMPEnabled = False
objNewPort.Put_

objNewPort.Name = "IP_192.168.100.201"
objNewPort.Protocol = 1
objNewPort.HostAddress = "192.168.100.201"
objNewPort.PortNumber = "9100"
objNewPort.SNMPEnabled = False
objNewPort.Put_


'This section adds print driver if needed

'Set objDriver = objWMIService.Get("Win32_PrinterDriver")
'objDriver.Name = "HP LaserJet"
'objDriver.SupportedPlatform = "Windows NT x86"
'objDriver.Version = "3"
'errResult = objDriver.AddPrinterDriver(objDriver)


'This section Creates Printers and points to print ports

Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_

objPrinter.DriverName = "HP LaserJet"
objPrinter.PortName = "IP_192.168.100.201"
objPrinter.DeviceID = "HP2430-201"
'objPrinter.Location = "location info here"
objPrinter.Network = True
objPrinter.Shared = True
objPrinter.ShareName = "HP2430_201"
objPrinter.Put_

objPrinter.DriverName = "HP LaserJet"
objPrinter.PortName = "IP_192.168.100.200"
objPrinter.DeviceID = "HP1320N-200"
'objPrinter.Location = "location info here"
objPrinter.Network = True
objPrinter.Shared = True
objPrinter.ShareName = "HP1320_200"
objPrinter.Put_

objPrinter.DriverName = "Generic / Text Only"
objPrinter.PortName = "IP_192.168.100.201"
objPrinter.DeviceID = "Generic / Text Only"
'objPrinter.Location = "location info here"
objPrinter.Network = True
objPrinter.Shared = True
objPrinter.ShareName = "Generic"
objPrinter.Put_

 

MaxDSP

Lifer
May 15, 2001
10,056
0
71
we're looking at implementing scripts in a few months, but for right now, I need a simpler (but more laborious) solution. The workstation are all running XP Pro btw.
 

MiniDoom

Diamond Member
Jan 5, 2004
5,305
0
76
we dont use scipts but for people who use office 2002/2003 you can send an email link to the printer. \\printserver\printer.