SharePoint - Site.RootWeb.AllUsers 未返回所有用户

发布于 2024-07-20 15:24:37 字数 441 浏览 6 评论 0原文

我有一个 SharePoint 网站,我为其创建了一些自定义 Web 部件。 其中之一需要获取 SharePoint 网站用户列表,以便我可以分配不同的属性。

代码:

Dim Site As New SPSite(SPContext.Current.Site.Url)
Dim AllUsers As SPUserCollection = Site.RootWeb.AllUsers
Dim u As SPUser
For Each u In AllUsers
    'SOME CODE FOR DISPLAY
Next

工作得很好,但昨天我添加了一个新用户,但他们没有出现在列表中。 我确实通过显示用户的默认页面在用户列表中看到了它们,所以我想知道为什么这段代码也不能吸引用户。

有谁知道为什么这不会返回 SharePoint 网站中的每个用户?

I have a SharePoint site that I created some custom web parts for. One of them requires getting the list of SharePoint site users so I can assign different properties.

The code:

Dim Site As New SPSite(SPContext.Current.Site.Url)
Dim AllUsers As SPUserCollection = Site.RootWeb.AllUsers
Dim u As SPUser
For Each u In AllUsers
    'SOME CODE FOR DISPLAY
Next

Was working great, but yesterday I added a new user and they didn't show up in the list. I definitely see them in the list of users through the default page that shows users, so I'm wondering why this code wouldn't get the user as well.

Does anyone know why this wouldn't return every user in the SharePoint site?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

霊感 2024-07-27 15:24:37

并非 sharepoint 中的所有用户集合都是平等创建的。 细微差别:

http://www.sharepointblogs.com/tingfong/archive/2007/08/21/sharepoint-spweb-allusers-vs-spweb-users-vs-spweb-groups.aspx

(快速回答对于懒惰的人 - AllUsers 显示活跃用户,即至少与网站集交互过一次的用户)

-Oisin

Not all user collections in sharepoint are created equally. Subtle differences:

http://www.sharepointblogs.com/tingfong/archive/2007/08/21/sharepoint-spweb-allusers-vs-spweb-users-vs-spweb-groups.aspx

(quick answer for the lazy - AllUsers shows active users, i.e. those who have interacted with the sitecollection at least once)

-Oisin

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文