3 # Display the changeid for a list of printers given on the command line
7 # changeid.py '\\win2kdc1\magpie'
11 from samba import spoolss
13 if len(sys.argv) == 1:
14 print "Usage: changeid.py <printername>"
17 for printer in sys.argv[1:]:
22 hnd = spoolss.openprinter(printer)
24 print "error opening printer %s" % printer
27 # Fetch and display changeid
29 info = hnd.getprinter(level = 0)
30 print info["change_id"]
34 spoolss.closeprinter(hnd)