SharePoint – PowerShell ile User Profile Picture Senkronizasyonu

0
286

SharePoint 2016 ve SharePoint 2019 ‘da maalesef kullanıcıların resimleri düzgün bir şekilde aktarılamamaktadır. Bu durum içinde Microsoft Identity Manager kurulması ve konfigürasyon işleminin yapılmasına ihtiyaç duyulmaktadır. Bu da ek maliyet ve efora sebep olmaktadır. AD içerisindeki resimleri SharePoint ‘e aktarmak için aşağıdaki scripti download ederek kullanmaya başlayabilirsiniz.

Scripti çalıştırmadan önce User Profile Service tarafında AD connection tanımlanması, MySite konfigüre edilmiş olması ve sync işleminin başlatılarak profillerin yüklenmesi gerekmektedir.

Yukarıdaki scripti indirdikten sonra aşağıdaki kısımları kendi ihtiyacınıza göre güncelleyip, kullanmaya başlayabilirsiniz.

Script içerisinde “User Photos/Profile Pictures” klasörüne resimleri oluşturmaktadır. Türkçe olarak açılan site ‘larda “Profile Pictures” ibaresini “Profil Resimleri” olarak değiştiriniz.

$Location = "C:\Dirsync\"
#First time running, just run "DirSync" then "UploadPicture $adusers"
#Update RootDSE to match your domain
$RootDSE = [ADSI]"LDAP://dc=contoso,dc=com"
$site	  = Get-SpSite http://MySiteHostURL
$domain = "domain\"
#This is for domains that may not resolve the short name.  We can have a domain controller, FQDN, or shortname for the domain.
$DCorDomainName = "Contoso.com"
#This will write the pictures to the folder specified in $location
$write2disk = $false
#LDAP filter that is currently set to pull in users with thumbnailphoto and not disabled users.
$LDAPFilter = "(&(objectCategory=person)(objectclass=user)(thumbnailphoto=*)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))"
#Set $UseDifferentSvcAccount to true to be prompted for a different service account.  False will use the user that is running the script to connect to AD.
$UseDifferentSvcAccount = $false

Kaynakça: https://gallery.technet.microsoft.com/office/SharePoint-User-Profile-928b39c0

CEVAP VER

Please enter your comment!
Please enter your name here