locked
Manager not updating with User Synchronization RRS feed

  • Question

  • My User Synchronization runs every morning at 1am and appears to be working fine.  If a new user is added to AD today, their profile is imported when the synchronization runs again.  I noticed though that the user's manager, as listed in AD, is not included though.  In AD, I can see their manager but if I check their profile in User Profile Service Application>Manage User Profiles, the manager field is blank. 

    I checked User Properties and I can see the Manager field is mapped to "manager", yet the manager still shows as blank when the user is imported.  What could be causing the issue and how can this be resolved?


    EDIT - I edited the existing "Manager" property and looked at the mapping selection dropdown list.  I am noticing that "manager" does not appear anywhere in the list of properties from AD to map to.  Very strange
    Tuesday, April 24, 2012 7:10 PM

Answers

  • Mapping Attributes missing from the “Attributes” drop down

    In certain cases, the attribute that you are trying to map may not be visible in the attributes drop down on the user profile property creation page. In this case, you will need to use PowerShell to map the LDAP attribute to SharePoint profile property. In order to run the script successfully, pleas ensure the following:

    1. You know the name (not Display Name) of the SharePoint Profile Property to which you need to map the attribute
    2. You know the name of the LDAP attribute that you wish to map (case sensitive)
    3. You are logged in as the farm account (the account under which the timer service and central administration application pool is running)
    4. The user profile service application where you need to perform the mapping should be the default service application associated to the central administration web site. Here is how you can verify this:
      • From central administration, click on “Application Management” on the left navigation bar
      • Click on “Manage Web Applications”
      • Select “SharePoint Central Administration v4”
      • From the Ribbon menu, click on “Service Connections”
      • Verify that from the list of connections, the user profile service application that you are performing the mapping for is checked and is set as the default service connection.
      • If the user profile service application proxy where you are performing the mapping is not set as default, please select “custom” as the service connection group and then choose the user profile service application connection that you are working with to perform the mapping.

    After you have verified the above, please run the following script to perform the property mapping. Set the value of $url to the url of the central administration web site. Update the values of $spsProperty, $fimProperty and $connectionName to match your environment. Note that the direction of this mapping will be “Import”.

    $url = "http://tehnoonr-ws08-4:1125" #URL of any site collection that is associated to the user profile service application.
    $spsProperty = "EID" #Internal name of the SharePoint user profile property
    $fimProperty = "employeeNumber" #Name of the attribute in FIM/LDAP source
    $connectionName = "sun" #Name of the SharePoint synchronization connection

    $site = Get-SPSite $url

    if ($site)
    {Write-Host "Successfully obtained site reference!"}
    else
    {Write-Host "Failed to obtain site reference"}

    $serviceContext = Get-SPServiceContext($site)

    if ($serviceContext)
    {Write-Host "Successfully obtained service context!"}
    else
    {Write-Host "Failed to obtain service context"}
    $upManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($serviceContext)

    if ($upManager)
    {Write-Host "Successfully obtained user profile manager!"}
    else
    {Write-Host "Failed to obtain user profile manager"}
    $synchConnection = $upManager.ConnectionManager[$connectionName]

    if ($synchConnection)
    {Write-Host "Successfully obtained synchronization connection!"}
    else
    {Write-Host "Failed to obtain user synchronization connection!"}

    Write-Host "Adding the attribute mapping..."
    $synchConnection.PropertyMapping.AddNewMapping([Microsoft.Office.Server.UserProfiles.ProfileType]::User, $spsProperty, $fimProperty)
    Write-Host "Done!"

    Perform a full synchronization after the mapping has been created.

    Hope this has been helpful!

    http://blogs.msdn.com/b/tehnoonr/archive/2010/11/22/mapping-user-profile-properties-in-sharepoint-2010-to-ldap-attributes.aspx

    HINT***

    User profile property is Manager

    while AD DS attribute is manager

    Wednesday, April 25, 2012 6:12 AM

All replies

  • Mapping Attributes missing from the “Attributes” drop down

    In certain cases, the attribute that you are trying to map may not be visible in the attributes drop down on the user profile property creation page. In this case, you will need to use PowerShell to map the LDAP attribute to SharePoint profile property. In order to run the script successfully, pleas ensure the following:

    1. You know the name (not Display Name) of the SharePoint Profile Property to which you need to map the attribute
    2. You know the name of the LDAP attribute that you wish to map (case sensitive)
    3. You are logged in as the farm account (the account under which the timer service and central administration application pool is running)
    4. The user profile service application where you need to perform the mapping should be the default service application associated to the central administration web site. Here is how you can verify this:
      • From central administration, click on “Application Management” on the left navigation bar
      • Click on “Manage Web Applications”
      • Select “SharePoint Central Administration v4”
      • From the Ribbon menu, click on “Service Connections”
      • Verify that from the list of connections, the user profile service application that you are performing the mapping for is checked and is set as the default service connection.
      • If the user profile service application proxy where you are performing the mapping is not set as default, please select “custom” as the service connection group and then choose the user profile service application connection that you are working with to perform the mapping.

    After you have verified the above, please run the following script to perform the property mapping. Set the value of $url to the url of the central administration web site. Update the values of $spsProperty, $fimProperty and $connectionName to match your environment. Note that the direction of this mapping will be “Import”.

    $url = "http://tehnoonr-ws08-4:1125" #URL of any site collection that is associated to the user profile service application.
    $spsProperty = "EID" #Internal name of the SharePoint user profile property
    $fimProperty = "employeeNumber" #Name of the attribute in FIM/LDAP source
    $connectionName = "sun" #Name of the SharePoint synchronization connection

    $site = Get-SPSite $url

    if ($site)
    {Write-Host "Successfully obtained site reference!"}
    else
    {Write-Host "Failed to obtain site reference"}

    $serviceContext = Get-SPServiceContext($site)

    if ($serviceContext)
    {Write-Host "Successfully obtained service context!"}
    else
    {Write-Host "Failed to obtain service context"}
    $upManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($serviceContext)

    if ($upManager)
    {Write-Host "Successfully obtained user profile manager!"}
    else
    {Write-Host "Failed to obtain user profile manager"}
    $synchConnection = $upManager.ConnectionManager[$connectionName]

    if ($synchConnection)
    {Write-Host "Successfully obtained synchronization connection!"}
    else
    {Write-Host "Failed to obtain user synchronization connection!"}

    Write-Host "Adding the attribute mapping..."
    $synchConnection.PropertyMapping.AddNewMapping([Microsoft.Office.Server.UserProfiles.ProfileType]::User, $spsProperty, $fimProperty)
    Write-Host "Done!"

    Perform a full synchronization after the mapping has been created.

    Hope this has been helpful!

    http://blogs.msdn.com/b/tehnoonr/archive/2010/11/22/mapping-user-profile-properties-in-sharepoint-2010-to-ldap-attributes.aspx

    HINT***

    User profile property is Manager

    while AD DS attribute is manager

    Wednesday, April 25, 2012 6:12 AM
  • Hi, I'm new to power shell and SharePoint 2013, can you please explain how the script above is supposed to be run? All at once or section by section?

    Thanks

    Monday, August 17, 2015 1:59 PM