none
Reading User Profile mapping programatically

    Question

  • is there a way to get the user profile mapping using C#?  We are mapping user profile attributes to AD.
    Friday, August 23, 2013 3:40 PM

Answers

  • Hi mr.kf,

    To get the user profile property mapping, please use UserProfileConfigManager.ConnectionManager[“connection”].PropertyMapping:

    Add-Type -Path "c:\program files\common files\microsoft shared\web server extensions\14\isapi\microsoft.office.server.dll"

    $siteUrl = "http://portal.tomresing.local"

    $site = Get-SPSite $siteUrl

    $context = Get-SPServiceContext $site

    $upConfigManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($context)

    $connectionManager = $upConfigManager.ConnectionManager

    $connection = $connectionManager["tomresing.local"]

    $pmc = $connection.PropertyMapping

    $pmc.GetEnumerator()

    $site.Dispose()

    More information: User Profile Property and Property Mapping Troubleshooting:
    http://tomresing.com/blog/Lists/Posts/Post.aspx?ID=35

    Thanks,


    Qiao Wei
    TechNet Community Support

    Monday, August 26, 2013 7:36 AM

All replies