force password reset script

trevorspecht
New Contributor

I am using the following script to force a password reset on next login for the current logged-in user. This works fine locally when run in command line. It used to work as a script run via Jamf self-service pre-10.14, but with Macs running 10.14+ it does nothing when run via self-service. Still works fine in command line. Any ideas?

#!/bin/bash
pwpolicy -u `whoami` -setpolicy "newPasswordRequired=1"
3 REPLIES 3

gachowski
Valued Contributor II

We are using

#!/bin/sh
pwpolicy -u $3 -setpolicy "newPasswordRequired=1"

and it was worked in all our testing..

C

CypherCookie
Contributor

don't forget that whoami when the script is executed is actually the jamf admin account. You need to specify the user as @gachowski script does.

martingownes
New Contributor

https://www.jamf.com/jamf-nation/discussions/25095/password-change-script