如何使用首选名称在SharePoint客户端对象模型中获取用户的配置文件属性? [英] How to get the profile properties of a user in SharePoint client object model using Preferred Name ?

查看:119
本文介绍了如何使用首选名称在SharePoint客户端对象模型中获取用户的配置文件属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在通过传递用户的首选名称来在SharePoint客户端对象模型中获取用户的配置文件属性的方法?

我们正在使用UserProfileService Web服务,它具有通过传递用户名而不是首选名称"来获取用户配置文件的方法.

在此先感谢.

Is there a method to get the profile properties of a user in SharePoint client object model by passing Preferred Name of the user?

We are using UserProfileService web service and it has method to get the user profile by passing the username but not Preferred Name.

Thanks in advance.

推荐答案

我找到了解决方法....

用户用户= clientContext.Web.EnsureUser(首选名称");

clientContext.Load(user);

clientContext.ExecuteQuery();

现在,user.LoginName将提供用户的用户名,然后我们可以利用UserProfileService Web服务获取用户配置文件属性.

userprofileservice.UserProfileService svc =新的userprofileservice.UserProfileService();

userprofileservice.PropertyData []属性= svc.GetUserProfileByName(userNoeId);
I found the solution ....

User user = clientContext.Web.EnsureUser("Preferred Name");

clientContext.Load(user);

clientContext.ExecuteQuery();

Now user.LoginName will give the username of the user and then we can make use of the UserProfileService web service to get the user profile properties.

userprofileservice.UserProfileService svc = new userprofileservice.UserProfileService();

userprofileservice.PropertyData[] properties = svc.GetUserProfileByName(userNoeId);


这篇关于如何使用首选名称在SharePoint客户端对象模型中获取用户的配置文件属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆