Hi,
I have been banging my head against the wall all day trying to figure this out. We are migrating our Print Server from Windows 2000 Server to Windows Server 2003. I found some cool scripts that run on Windows XP and Windows Server 2003 that I thought would make my life easier. Silly me!
I developed my script on XP and everything seems to work. I create over 300 printers in a few minutes. I went over to my 2003 Server and it won't run.
I get an Access Denied message. The Error Code is 80041003. The Source is SWbemObjectEx.
First off, I am using the local Administrator account on the server.
Second, I thought it was some sort of policy setting that our Domain was applying. So I rebuilt the server and did not join it to a domain. It has all default security settings applied.
This code is a sample to create an IP Printer Port. I got it from microsofts site. It does not work on Server 2003.
Set objWMIService = GetObject("winmgmts:")
Set objNewPort = objWMIService.Get _
("Win32_TCPIPPrinterPort").SpawnInstance_
objNewPort.Name = "IP_169.254.110.14"
objNewPort.Protocol = 1
objNewPort.HostAddress = "169.254.110.14"
objNewPort.PortNumber = "9999"
objNewPort.SNMPEnabled = False
objNewPort.Put_
The line the program aborts on is the last line. objNewPort.Put_
According to Microsofts website this should work on Server 2003. But I can't figure it out.
I am hoping I am just missing something simple.
Any help would be greatly appreciated.