none
Get list of active external users, currently having access to site. RRS feed

  • Question

  • I am facing a requirement in which i need to get details of active external users for site on SPO sites. I found sharepoint having property as rootweb.SiteUsers which return all the users (including internal and external). But it returns all the user which are being added to site irrespective currently having access or not. Whereas  in my case , i need only such external users which are currently having access.

    I  tried to look for any property(using CSOM,RestApi) which differentiate if the user is having access or not but could not find any of them. Is that SP having any hidden property which distinguish added external users are as active or not.

    Any help will be appreciated. 

     
    Tuesday, March 21, 2017 9:14 AM

All replies

  • Hi,

    Please check the Microsoft.SharePoint.Client.User members, it seems not a property  to use distinguish user active or not.

    https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.user_members.aspx

    As a workaround, we can write some JavaScript to get current user information, then use REST API to add the user information into a custom list. Then we can get the active user information in this custom list.

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, March 22, 2017 8:39 AM
    Moderator
  • Thank @Dennis for reply - but this will not be the appropriate approach, as still we cannot identify whether the user is currently having access or not. In other words the users are not be removed from list although if sharing stops.

    In my requirement - it is like - if in beginning  external users are added to site are 100. and currently on 50 users are having access to site or files or folder. So i need the details of those 50 users. As currently i can get all 100 users details.

    Wednesday, March 22, 2017 9:54 AM
  • Hi,

    You can add the code into master page, and add data time into custom list.

    And then create a job to manage the custom list, if the user remove from site, we can remove the user's item in the list.

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, April 5, 2017 3:47 AM
    Moderator