I have a FREEIPA LDAP server and a Mavericks Client. I have bound my Mac to my ldap and created a mobile account.
What I want is when someone is disabled it logs out the user or locks the screen.
I have a FREEIPA LDAP server and a Mavericks Client. I have bound my Mac to my ldap and created a mobile account.
What I want is when someone is disabled it logs out the user or locks the screen.
Thanks Joe, your comment lead me to look at ldapsearch, I haven't created a cron job for it yet but that's my plan. With FreeIPA (Thanks Rob Crittenden!) it uses nsaccountlock to tell you if the user is disabled or not. It value will be FALSE or empty if they are enabled and TRUE if they are locked.
ldapsearch -LLL -h ldap.server.com -p 389 -x -b \
"uid=cwhittl,cn=users,cn=accounts,dc=domain,dc=com" \
nsaccountlock | grep '^nsaccountlock' | cut -d ' ' -f 2
or with simple auth
ldapsearch -LLL -h ldap.server.com -p 389 -x -D \
"uid=mac_slave,cn=users,cn=accounts,dc=domain,dc=com" \
-w 'N@ch0PassW0rd!' -b "uid=cwhittl,cn=users,cn=accounts,dc=domain,dc=com" \
nsaccountlock | grep '^nsaccountlock' | cut -d ' ' -f 2