Create User Profile Synchronization Connection in SharePoint 2016 using PowerShell

User Profile Service Synchronization Connection in SharePoint specifies the source for importing user profiles from Active Directory or any other profile source. The user profile import operation is unidirectional in SharePoint 2016 (from Active Directory to SharePoint) which populates user profile data in user profile service application from Active Directory.

How to Create user profile synchronization connection for SharePoint using PowerShell?
As in previous versions of SharePoint,  An import connection can be created the user Profile service Application. To add new synchronization connection in SharePoint 2016:
  • Go to SharePoint 2016 Central Administration >> Application Management 
  • Manage Service applications >> select User Profile Service application 
  • On User profile service application page, click on "Configure Synchronization Connections" >> Create New Connection
    create user profile synchronization connection powershell
  • Fill in the details according to your environment. Such as:
    • Connection Name, The Fully Qualified Domain Name, Authentication Provider Type
    • The user account and password of the account that will retrieve the user profile information.
    • The TCP Port (defaults to 389, for LDAP). whether to use an SSL-secured connection, Filter out disabled users, and another option for Filtering in the LDAP syntax.
      Create User Profile Synchronization Connection in SharePoint 2016
    • Click on Populate Containers and Select which container in Active Directory is to be synchronized in this connection.
PowerShell Script to create user profile synchronization connection:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Configuration Parameters
$ImportDomain = "Crescent"
$ImportPassword = Read-host "Enter the Password for Import Account:" -AsSecureString 
$ServiceAppName="User Profile Service Application"
$FilterDisabledUsers = $True
#Get User Profile Service application
$UPS=Get-SPServiceApplication -Name $ServiceAppName

#Create User Profile Synchronization Connections 
Add-SPProfileSyncConnection -ProfileServiceApplication $UPS -ConnectionForestName $ForestName -ConnectionDomain $ImportDomain -ConnectionUserName $ImportUserName -ConnectionPassword $ImportPassword -ConnectionSynchronizationOU $ImportOU -ConnectionUseDisabledFilter $FilterDisabledUsers

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.