Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User

Status
Not open for further replies.

hieucao

MIS
Oct 9, 2006
7
US
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
 
Is this a VBScript question, or a VB 5 or 6 question? The correct forum for VBScript questions is

forum329

Lee
 
Thanks Lee. I'll post it in the correct forum.

Hieu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top