1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-12 23:17:06 +03:00
Tim Potter d4b6d5db91 Updated examples for new top level module layout.
Fixed some bugs also.
(This used to be commit 3e19e3afdb6fd1f63dee9ca52a5d33090670832e)
2002-09-10 06:41:27 +00:00

35 lines
615 B
Python
Executable File

#!/usr/bin/python
#
# Display the changeid for a list of printers given on the command line
#
# Sample usage:
#
# changeid.py '\\win2kdc1\magpie'
#
import sys
from samba import spoolss
if len(sys.argv) == 1:
print "Usage: changeid.py <printername>"
sys.exit(1)
for printer in sys.argv[1:]:
# Open printer handle
try:
hnd = spoolss.openprinter(printer)
except:
print "error opening printer %s" % printer
sys.exit(1)
# Fetch and display changeid
info = hnd.getprinter(level = 0)
print info["change_id"]
# Clean up
spoolss.closeprinter(hnd)