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 6882445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:15:14+00:00 2026-05-27T05:15:14+00:00

If a user is removed from AD, the user still exists in sharepoint. Now

  • 0

If a user is removed from AD, the user still exists in sharepoint. Now i want to check if a user exists in AD, so is there any sharepoint object model can do this?

Thanks in advance.

  • 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-27T05:15:15+00:00Added an answer on May 27, 2026 at 5:15 am

    If the user is in the domain user Group, it collects all users under that user group and loops the list to that try to find the current user. If a user is found, it returns true, otherwise returns false.

    Check this article Check Whether User Exists in Active Directory that include some security related issues to achieve the requirement.

    // Get ad users in the groups. Since MOSS does
                        // not support nested groups
                        // this will always be a collection of AD users
                        // and groups
                        foreach (SPUser user in group.Users)
                        {
                            // Check if this is a Group
                            if (!user.IsDomainGroup)
                            {
                                // Verify if the user name matches the user name in group
                                if (user.LoginName.ToUpper().Equals(upperCaseUserName))
                                {
                                    // if a match is confirmed, return from the method.
                                    // There is no need to continue
                                    userIsInGroup = true;
                                    return; 
                                }
                            }
                            else {
                            // If the AD entity is a User Group,
                            // then check for users in that group
                            if (IsUserInADGroup(web, user.LoginName, 
                                username, out reachedMax))
                            {
                                userIsInGroup = true;
                                return;
                            }
                        }
    

    Hope this help..

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

Sidebar

Related Questions

i got the error DEPRECATION WARNING: error_messages_for was removed from Rails and is now
UPDATE 2: I have now removed the following from the .php file: <?php error_reporting(
This is a follow-up question on Delete field from standard Django model . In
I am using the following code to remove a attribute from session List<User> l=(List<User>)
I have stack panel with custom controls in it. User can add or remove
My app used to use the Settings.bundle to load settings from the user, but
I have this code and it takes the location where the user pressed on
This view function: @login_required def dashboard(request): from myproject.myapp.models import UserProfile k = UserProfile.objects.get( user=request.user.pk
I have a situation where I want to associate multiple values from one table
I need to remove an image from sd card chosen by user. In my

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.