Background: I am using MS VB script to install ip printers via KIX. I call this *.vbs file from a BAT file within KIX and it works fine, but it requires the user to have admin's rights on local computer in order for it to work.
Question:
Is there a way that you can have VB installs IP printer as 'admin'by adding UserName and Password parameters to this existing script and use that account to perform installation IP printers? Our user profiles do not have sufficient rights on our domain to install printers, so the only way that I know of is to have individual accounts set as "administrator" on local computer...
Current script as followed.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewPort = objWMIService.Get("Win32_TCPIPPrinterPort").SpawnInstance_
objNewPort.Name = "IP_192.168.24.37"
objNewPort.Protocol = 1
objNewPort.HostAddress = "192.168.24.37"
objNewPort.PortNumber = "9100"
objNewPort.SNMPEnabled = False
objNewPort.Put_
Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_
objPrinter.DriverName = "Xerox 4505 PS"
objPrinter.PortName = "IP_192.168.24.37"
objPrinter.DeviceID = "2FLX4500PS"
objPrinter.Location = "Mission Valley Admin"
objPrinter.Network = "True"
'objPrinter.Shared = "True"
'objPrinter.ShareName = "Test"
objPrinter.Put_
Your help is greatly appreciated!!
Thanks!
Hieu
Question:
Is there a way that you can have VB installs IP printer as 'admin'by adding UserName and Password parameters to this existing script and use that account to perform installation IP printers? Our user profiles do not have sufficient rights on our domain to install printers, so the only way that I know of is to have individual accounts set as "administrator" on local computer...
Current script as followed.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewPort = objWMIService.Get("Win32_TCPIPPrinterPort").SpawnInstance_
objNewPort.Name = "IP_192.168.24.37"
objNewPort.Protocol = 1
objNewPort.HostAddress = "192.168.24.37"
objNewPort.PortNumber = "9100"
objNewPort.SNMPEnabled = False
objNewPort.Put_
Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_
objPrinter.DriverName = "Xerox 4505 PS"
objPrinter.PortName = "IP_192.168.24.37"
objPrinter.DeviceID = "2FLX4500PS"
objPrinter.Location = "Mission Valley Admin"
objPrinter.Network = "True"
'objPrinter.Shared = "True"
'objPrinter.ShareName = "Test"
objPrinter.Put_
Your help is greatly appreciated!!
Thanks!
Hieu