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

  • SEARCH
  • Home
  • 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 8461575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:55:10+00:00 2026-06-10T13:55:10+00:00

The code below works just fine, however what’s happening is the code limits the

  • 0

The code below works just fine, however what’s happening is the code limits the results to 1500 users and we have more than 1500 users. What I’m trying to do is retrieve a list of all users that are a member of a specific group. I know DirectorySearcher has a PageSize setting however, I’m unable to find a way to set DirectoryEntry PageSize will still only pulling members of that group.

Does anybody know a way to change the page size? Or maybe how to pull members of a specific group in another fashion that will accommodate pagesize?

DirectoryEntry dEntryhighlevel = new DirectoryEntry("LDAP://CN=Users,OU=MyOu,OU=Clients,OU=Home,DC=bridgeTech,DC=net");
foreach (object dn in dEntryhighlevel.Properties["member"])
{
    DirectoryEntry singleEntry = new DirectoryEntry("LDAP://" + dn);
    DirectorySearcher dSearcher = new DirectorySearcher(singleEntry);
    //filter just user objects
    dSearcher.SearchScope = SearchScope.Base;
    //dSearcher.Filter = "(&(objectClass=user)(dn=" + dn + "))";
    //dSearcher.PageSize = 1000;
    SearchResult singleResult = null;
    singleResult = dSearcher.FindOne();
    if (singleResult != null)
    {
        string Last_Name = singleResult.Properties["sn"][0].ToString();
        string First_Name = singleResult.Properties["givenname"][0].ToString();
        string userName = singleResult.Properties["samAccountName"][0].ToString();
        string Email_Address = singleResult.Properties["mail"][0].ToString();
        OriginalList.Add(Last_Name + "|" + First_Name + "|" + userName + "|" + Email_Address);
    }
    singleEntry.Close();
}
  • 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-06-10T13:55:12+00:00Added an answer on June 10, 2026 at 1:55 pm

    I’m working on something similar to this at the moment and noticed that your code differs to mine slightly. I haven’t had any issues with limited results using the following code structure:

    DirectoryEntry dEntryhighlevel = new DirectoryEntry("LDAP://CN=Users,OU=MyOu,OU=Clients,OU=Home,DC=bridgeTech,DC=net");
    DirectorySearcher dSearcher = new DirectorySearcher();
    //filter just user objects
    dSearcher.Filter = "(objectClass=user)";
    dSearcher.PageSize = 1000;
    SearchResultCollection resultCollection = dirSearcher.FindAll();
    foreach (SearchResult userResults in resultCollection )
    {
        string Last_Name = userResults .Properties["sn"][0].ToString();
        string First_Name = userResults .Properties["givenname"][0].ToString();
        string userName = userResults .Properties["samAccountName"][0].ToString();
        string Email_Address = userResults .Properties["mail"][0].ToString();
        OriginalList.Add(Last_Name + "|" + First_Name + "|" + userName + "|" + Email_Address);
    }
    

    That should return all your users. You’ll need to use LDAP search patterns in your dSearcher.Filter in order to narrow users down to a specific group – see this link for some additional help with that.

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

Sidebar

Related Questions

I have this code below. It works fine in safari however in IE the
So, I have the code below which works fine when entered into Google's Rich
I'm just looking to optimize the code below. It works, but I want to
The code below works well right now; however, it's serially executed. I'd like to
The code below works fine. But it seem clunky. How would you combine the
the code below works fine but it takes an absolute age to run. How
The code below works great. I have a MySQL database that contains book titles
Can anyone help me figure this out? The below code works fine and gets
I have this code that creates the navigation for a slideshow. It works just
Edit: Just found out this is a chrome problem, the code works fine in

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.