[Samba] Logging print jobs

Luke Barone lukebarone at gmail.com
Wed May 12 22:46:07 UTC 2021

Is there a way to log who is printing how many pages to what printer on a
Samba Print Server?

We have an AD setup, and a plain Debian VM joined as a Domain Member
running CUPS and Samba. The printer is available to users, but every time
they print, it shows up as "Unknown" for the Name, and "Withheld" for the

The user we tested as so far is the Domain's Administrator account. We
would like it to list the Windows username (which is tied to AD) when
printing. Is there any way to do that?

I'm sure it's off topic, but I also cannot find the /var/log/cups/page_log
file on this server - looking at an old thread from April, 2019 (
https://marc.info/?l=samba&m=155420955300420&w=4), it appears that even if
I could, it would still list the unknown information.

Samba 4.9.5-Debian (installed from Buster repo, not Louis' repo)
CUPS 2.3.3 (installed from source)
Debian 10.9

smb.conf file (sanitized):

# Global parameters
        bind interfaces only = Yes
        client signing = required
        disable netbios = Yes
        interfaces = lo enp1s0
        log file = /var/log/samba/%m.log
        realm = DOMAIN.CA
        security = ADS
        server role = member server
        server signing = required
        template homedir = /home/test/%U
        winbind separator = /
        workgroup = DPTS
        spoolss: architecture = Windows x64
        rpc_daemon:spoolssd = fork
        rpc_server:spoolss = external
        idmap config dpts : range = 100000-199999
        idmap config dpts : backend = rid
        idmap config * : range = 70000-99999
        idmap config * : backend = tdb
        map acl inherit = Yes
        vfs objects = acl_xattr

        browseable = No
        path = /var/spool/samba/
        printable = Yes

        path = /usr/local/share/printer_drivers/
        read only = No

More information about the samba mailing list