Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 219531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:51:14+00:00 2026-05-11T18:51:14+00:00

I have a SharePoint site that I created some custom web parts for. One

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T18:51:14+00:00Added an answer on May 11, 2026 at 6:51 pm

    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

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom list in a SharePoint site and generated a Visual
I have items in a list in a SharePoint 2003 site that I need
I have created a custom list in SharePoint 2010 programmatically. It works fine on
I have some code that creates a new site in SharePoint. Upon browsing to
I am creating a site template in Sharepoint. I also have some custom .aspx
We have a SharePoint Team Site (WSS 3.0 not MOSS), that includes Tasks list
I'm building a new Intranet Portal with SharePoint 2007 that will have News, Site
I have a shared site in sharepoint and have some RSS feed webpart in
I have a list in SharePoint 2010 with some columns. All are default types.
I have a SharePoint feature that is activated under 'Site Collection Features' that is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.