Ok guys,
I've been away for a while but this one has me stumped.
This code works fine on a XP box but I get Access Denied on a 2k3 box. I'm an Admin on both, can anyone tell me why?
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewPort = objWMIService.Get("Win32_TCPIPPrinterPort").SpawnInstance_
objNewPort.Name = strName
objNewPort.Protocol = intProtocol
objNewPort.HostAddress = strHostAddress
objNewPort.PortNumber = intPort
objNewPort.SNMPEnabled = bolSNMP
objNewPort.SNMPCommunity = strSNMPCommunity
objnewPort.SNMPDevIndex = SNMPIndex
objNewPort.Put_
MCSE 2003: Security
MCDBA
I've been away for a while but this one has me stumped.
This code works fine on a XP box but I get Access Denied on a 2k3 box. I'm an Admin on both, can anyone tell me why?
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewPort = objWMIService.Get("Win32_TCPIPPrinterPort").SpawnInstance_
objNewPort.Name = strName
objNewPort.Protocol = intProtocol
objNewPort.HostAddress = strHostAddress
objNewPort.PortNumber = intPort
objNewPort.SNMPEnabled = bolSNMP
objNewPort.SNMPCommunity = strSNMPCommunity
objnewPort.SNMPDevIndex = SNMPIndex
objNewPort.Put_
MCSE 2003: Security
MCDBA