tuple = EnumPrinters(flags, name , level )

Enumerates printers, print servers, domains and print providers.


flags : int

types of printer objects to enumerate (combination of PRINTER_ENUM_* constants).

name=None : string

name of printer object.

level=1 : int

type of printer info structure (Levels 1,2,4,5 supported)


Use Flags=PRINTER_ENUM_NAME, Name=None, Level=1 to enumerate print providers.
Use Flags=PRINTER_ENUM_NAME, Name=\\servername, Level=2 or 5 to list printers on another server.
See MSDN docs for EnumPrinters for other specific combinations

Return Value

Level 1 returns a tuple of tuples for backward compatibility. Each individual element is a tuple of (flags, description, name, comment)
All other levels return a tuple of dictionaries representing PRINTER_INFO_* structures