當 LDAP 帳戶被停用時,如何強制 Mac 行動帳戶使用者登出或鎖定?

當 LDAP 帳戶被停用時,如何強制 Mac 行動帳戶使用者登出或鎖定?

我有一個 FREEIPA LDAP 伺服器和一個 Mavericks 用戶端。我已將 Mac 綁定到 LDAP 並建立了一個行動帳戶。

我想要的是當某人被禁用時,它會註銷用戶或鎖定螢幕。

答案1

謝謝喬,你的評論讓我看看 ldapsearch,我還沒有為它創建一個 cron 作業,但這就是我的計劃。對於 FreeIPA(感謝 Rob Crittenden!),它使用 nsaccountlock 來告訴您用戶是否已停用。如果啟用,則其值為 FALSE 或空;如果鎖定,則值為 TRUE。

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

或使用簡單的身份驗證

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

相關內容