I've written a neat little script for synchronizing the local user profile picture (also known as "face") on domain joined Linux workstations from Active Directory (thumbnailPhoto user attribute).
It should work on all GNOME based systems and probably on other desktop environments aswell which utilize the AccountsService.
Read more about this on my website: https://santeri.pikarinen.com/posts/ad_user_photo_on_linux/
$ export LDAP_URI='ldaps://dc01.contoso.com:636'
$ export LDAP_BASE='DC=contoso,DC=com'
$ ./update_face_from_ad.sh
Successfully updated local profile picture for user "santeri"!
$ ./update_face_from_ad.sh
Local profile picture for user "santeri" is already up-to-date!
- Save the attached script to
/usr/local/bin/update_face_from_ad
and make it executable. - Create and enable a Systemd user service
/etc/systemd/user/update-face-from-ad.service
(see attached example user service file) - Create and enable+start a Systemd user timer
/etc/systemd/user/update-face-from-ad.timer
(see attached example user timer file)
Reload the Systemd daemon after creating the unit files.
$ sudo systemctl daemon-reload
$ systemctl --user daemon-reload
Enable the service to make the profile picture automatically after login.
$ systemctl --user enable update-face-from-ad.service
Created symlink ...
Enable & start the timer to additionally update the profile picture daily at 12:00 PM (example).
$ systemctl --user enable --now update-face-from-ad.timer
Created symlink ...