none
Pulling a collection of users from a domain group synced from AD

    Question

  • I was wondering if there is a way to pull a collection of users like below for a Security Group that was synced to sharepoint online from AD

    It seems that this works when each member is individually added in a sharepoint group, but if it's a secruity group this api doesn't seem to return the users.

    Any ideas?

     getAllSiteUsersLogins: function () {
    
            var loginNames = [];
    
            $.ajax({
                type: "GET",
                async: false,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                url: 'https://burwoodgroupinc.sharepoint.com/_api/web/sitegroups(414)/users',
                success: function (result) {
                    $(result.value).each(function () {
                        loginNames.push(this.LoginName);
                    });
                },
                error: function (msg) {
                    console.log(msg);
    
                }
            });
    
            return loginNames;
        }
    


    • Edited by ryduclos Friday, February 17, 2017 12:05 AM
    Friday, February 17, 2017 12:03 AM

All replies

  • Hi,

    Yes, this API will only treat a Security Group as a SharePoint user, it can’t list all the users inside this Security Group for you.

    There is no such API provided in SharePoint Online or Office 365 can meet your requirement currently, you might need to query the users from your on-premises AD environment.

    Best regards,

    Patrick

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

    Monday, February 20, 2017 6:34 AM
    Moderator
  • Hi,

    Just want to know if my reply is helpful in your issue?

    Best regards,

    Patrick


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

    Wednesday, February 22, 2017 7:20 AM
    Moderator