有没有办法从对象模型中搜索MOSS中的配置文件?我需要搜索在他们的个人资料上设置了特定值的个人资料,然后为他们执行一些操作。SharePoint用户配置文件搜索
我需要编写一些可以搜索配置文件数据库并返回匹配配置文件的c#代码。基本上,
列表的配置文件=选择配置文件从配置文件存储在哪里配置文件属性值= someValue中
我试图避免以下:
private IEnumerable<UserProfile> SearchProfiles(string value) {
ServerContext serverContext = ServerContext.GetContext(SPContext.Current.Site);
UserProfileManager profileManager = new UserProfileManager(serverContext);
foreach (UserProfile profile in profileManager) {
if ((string)profile["MyProp"].Value == value) {
yield return profile;
}
}
}
6年后,我知道,但为什么我不能在SPContext.Current.Site中使用RunWithElevatedPrivileges? – 2016-05-25 13:04:25