[Samba] Smba 4, looking for a command to show the password expiration date

Mario Pio Russo mariopiorusso at ie.ibm.com
Wed May 6 07:15:44 MDT 2015

Good day all

I am developing a tool in perl to run on my sabma4-DC. This tool must check
the password exp date and send a reminder when quite close. Now in order to
do that, I need a command to extract the expiration date from samba 4.

I have used pdbedit but it looks like the files "password must change" is
not reporting correctlly the exp date, in fact I see:

Unix username:        mariopio
NT username:
Account Flags:        [U          ]
User SID:             S-1-5-21-2561872439-3810134724-4206319815-8276
Primary Group SID:    S-1-5-21-2561872439-3810134724-4206319815-513
Full Name:            Mario Pio Russo/Ireland/IBM
Home Directory:
HomeDir Drive:        (null)
Logon Script:         logon.bat
Profile Path:
Account desc:         mariopiorusso at ie.ibm.com
Munged dial:
Logon time:           0
Logoff time:          Tue, 19 Jan 2038 03:14:07 GMT
Kickoff time:         Tue, 19 Jan 2038 03:14:07 GMT
Password last set:    Tue, 28 Apr 2015 10:46:05 BST
Password can change:  Tue, 28 Apr 2015 10:46:05 BST
Password must change: never
Last bad password   : 0
Bad password count  : 0

while If I run kinit, I correctlly see the expiration date as set by the
passwd age:

root at ccdc-samba4:~/automation-scripts# kinit mariopio at CCDC.LAN
Password for mariopio at CCDC.LAN:
Warning: Your password will expire in 81 days on Mon 27 Jul 2015 10:46:05

any help is appreciated


Mario Pio Russo, System Admin SWG IT Services Dublin, Phone & FAX: +353 1
815 2236, eMail: mariopiorusso at ie.ibm.com
IBM Ireland Product Distribution Limited registered in Ireland with number
92815. Registered Office: IBM House, Shelbourne Road, Ballsbridge, Dublin 4

(Embedded image moved to file: pic43630.gif)

More information about the samba mailing list