Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sharepoint MOSS2007 UserProfile属性:对“的编程访问”;映射属性";在广告中_Sharepoint_User Profile - Fatal编程技术网

Sharepoint MOSS2007 UserProfile属性:对“的编程访问”;映射属性";在广告中

Sharepoint MOSS2007 UserProfile属性:对“的编程访问”;映射属性";在广告中,sharepoint,user-profile,Sharepoint,User Profile,您可能知道,MOSS 2007提供了将Active Directory属性与SharePoint用户配置文件属性同步的功能。您可以在中将广告属性映射到用户配置文件属性 共享服务>用户配置文件和属性>查看配置文件属性(一直在底部) 我目前正在研究将用户配置文件上的修改同步回AD的可能性 我是SharePoint的新手,在其API中苦苦挣扎,但到目前为止我发现,您可以迭代用户配置文件的更改,并找出时间戳、旧值、新值等 string siteUrl = @"http://[siteUrl]/"

您可能知道,MOSS 2007提供了将Active Directory属性与SharePoint用户配置文件属性同步的功能。您可以在中将广告属性映射到用户配置文件属性 共享服务>用户配置文件和属性>查看配置文件属性(一直在底部)

我目前正在研究将用户配置文件上的修改同步回AD的可能性

我是SharePoint的新手,在其API中苦苦挣扎,但到目前为止我发现,您可以迭代用户配置文件的更改,并找出时间戳、旧值、新值等

    string siteUrl = @"http://[siteUrl]/";
    Microsoft.SharePoint.SPSite spsite = new Microsoft.SharePoint.SPSite(url);
    Microsoft.Office.Server.ServerContext serverContext = Microsoft.Office.Server.ServerContext.GetContext(spsite);
    Microsoft.Office.Server.UserProfiles.UserProfileManager userProfileMgr = new Microsoft.Office.Server.UserProfiles.UserProfileManager(serverContext);
    var collection = userProfileMgr.GetChanges();

    List<ProfilePropertyChange> changes = new List<ProfilePropertyChange>();
    foreach (Microsoft.Office.Server.UserProfiles.UserProfileChange change in collection)
    {
        if (change.ObjectType == Microsoft.Office.Server.UserProfiles.ObjectTypes.SingleValueProperty)
        {
            var singleValue = change as Microsoft.Office.Server.UserProfiles.UserProfileSingleValueChange;

        string oldValue = singleValue.OldValue;
        string newValue = singleValue.NewValue;
        var profileProperty = singleValue.ProfileProperty;
        DateTime modificationDate = singleValue.EventTime;

        ...

        }
    }
string siteUrl=@“http://[siteUrl]/”;
Microsoft.SharePoint.SPSite SPSite=新的Microsoft.SharePoint.SPSite(url);
Microsoft.Office.Server.ServerContext ServerContext=Microsoft.Office.Server.ServerContext.GetContext(spsite);
Microsoft.Office.Server.UserProfiles.UserProfileManager userProfileMgr=新的Microsoft.Office.Server.UserProfiles.UserProfileManager(serverContext);
var collection=userProfileMgr.GetChanges();
列表更改=新列表();
foreach(Microsoft.Office.Server.UserProfiles.UserProfileChange集合中的更改)
{
if(change.ObjectType==Microsoft.Office.Server.UserProfiles.ObjectTypes.SingleValueProperty)
{
var singleValue=更改为Microsoft.Office.Server.UserProfiles.UserProfileSingleValueChange;
字符串oldValue=singleValue.oldValue;
字符串newValue=singleValue.newValue;
var profileProperty=singleValue.profileProperty;
DateTime modificationDate=singleValue.EventTime;
...
}
}
然而,我目前无法发现的是对所谓的“映射属性”(AD中的原始属性名)的编程访问

有人能给我指一下SharePoint API,它可以为我展示这些信息吗


非常感谢

史蒂夫·科伦在MSDN论坛上回答了我的问题:

使用PropertyMapCollection 可以查找映射的广告 属性指定了Userprofile名称

DataSource ds=upcm.GetDataSource(); PropertyMapCollection pmc= 属性映射


Steve Curran在MSDN论坛上回答了我的问题:

使用PropertyMapCollection 可以查找映射的广告 属性指定了Userprofile名称

DataSource ds=upcm.GetDataSource(); PropertyMapCollection pmc= 属性映射