Password Expiration Notification - Local Accounts (Non-AD)

New Contributor II

I've read several discussions around providing users with local accounts a warning message around password expiration. I have attempted to use the scripts but they all seem to fail. What I'm looking for is...

1) Warn users with local accounts on MacBooks (Catalina or bigSur) of their password expiring in X number of days
2) Within the warning, create an action button to allow them to change their password on the spot
3) Have the script run every day and only show the warning if their password will expire within 30 days.

Again, this is for non-AD accounts. Any help would be greatly appreciated.

Some references I used but can't seem to get the right fit.
1) Current-User-Password-Age -

2) password-expiration-warning-without-active-directory (this hasn't been updated or commented on in years) -


New Contributor III

How are you enforcing password expiration limits? Are you using MacOS Server?

New Contributor III

Also, can you please provide details on

I have attempted to use the scripts but they all seem to fail.

How did they fail? It would be easier to diagnose where your script is failing, rather than starting from scratch as no one knows what your environment looks like and/or how your machines are managed.