I could not find a pdbedit or smbldap-userlist option to list just the active samba users.
Solution on Question  lists all users and machines and smbldap-userlist -ua lists all users, even if they are inactive. I mean Inactive, not a logged off user but a user that is not active on the domain anymore.
I tried awk and grep to parse the output but I could not match a pattern on [status SMB] column.
Does somebody has a command-line or shell solution? (although, a Python solution will be very welcome)