Sharepoint Site Users (Displays deleted users)

unknown_25 21 Reputation points
2021-05-11T10:15:18.42+00:00

Hi,

When

var context=getContext();
context.web.siteusers gets the names of deleted sharepoint users.is there is a way to get only available sharepoint users excluding the deleted users

FYR

tried ctx.Web.EnsureUser(u.LoginName) with the deleted name still it returns true
tried getting deleted property it states as false.
checked the permission for user in site there was no permissions

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,211 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,563 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,557 questions
0 comments No comments
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,001 Reputation points
    2021-05-12T01:41:43.723+00:00

    Hello @unknown_25 ,

    By default, all the users(including deleted users) are stored in a list called user information list in your site. When we use csom get users, it would get the uses form that user infomation list.

    You could remove the deleted users from that list to avoid this. The url of the list is: httpss://yoursite/_layouts/15/people.aspx?MembershipGroupId=0

    95761-image.png


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful