ProfileProvider:获取的所有配置文件清单 [英] ProfileProvider: retrieve list of all profiles

查看:310
本文介绍了ProfileProvider:获取的所有配置文件清单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个asp.net内部网站有ActiveDirectoryMembershipProvider和的SqlProfileProvider。

I'm developing an asp.net intranet website with a ActiveDirectoryMembershipProvider and a SqlProfileProvider.

我的一个网站的要求,是有一个生日页面,这就需要我列出所有的配置文件,并从中获取生日信息。

One of the requirements of my website is to have a "Birthdays" page, which would require me to list all profiles and retrieving the birthday information from it.

我走近这个问题如下:


  • 调用Membership.GetAllUsers()静态方法;

  • 通过用户列表迭代和检索会员的用户名的配置文件

这个方法,但是,失败原因如下:

This approach, however, failed for the following reasons:


  • web应用程序正在模拟当前登录用户检索其广告信息(身份冒充在web.config =真),所以我得到一个异常访问被拒绝试图调用GetAllUsers时

  • 如果我试着让Web应用程序模拟一个超级用户帐户,然后AD返回用户名作为用户名@域名格式,但在我的个人资料提供者,他们最初被存储为域名\\用户名格式。

那么,你将如何去解决这个问题,以获取配置文件的整个列表的组织的任何成员?

So, how would you go around this problem to retrieve the whole list of profiles for any member of the organization?

推荐答案

有与方法GetAllProfiles一个ProfileManager():

There is a ProfileManager with the a method GetAllProfiles():

http://msdn.microsoft.com/en-us/library/system.web.profile.profilemanager.getallprofiles.aspx

这篇关于ProfileProvider:获取的所有配置文件清单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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