Right I got it working.  I had to put a printer port in aswell.  I'll
now look at a script to create printer ports.  My goal is being able to
query the printers on print server x and then recreate the printers
(shares and ports) on print server y.

Thanks, for all your help Tim, much appreciated. MW

import win32com.client
WBEM =
win32com.client.GetObject(r"winmgmts:{impersonationLevel=impersonate}!\\"
+ "." + r"\root\cimv2")
printer = WBEM.Get("Win32_Printer").SpawnInstance_()
printer.Properties_('DeviceID').Value = 'myprinter'
printer.Properties_('DriverName').Value = 'HP 2000C'
printer.Properties_('Location').Value = 'myoffice'
printer.Properties_('Network').Value = 'True'
printer.Properties_('Shared').Value = 'True'
printer.Properties_('ShareName').Value = 'myprintershare'
printer.Properties_('PortName').Value = 'IP_169.254.110.14'
printer.Put_()

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to