Get all user profiles by REST api RRS feed

  • Question

  • Hi,

    I have created user profile service application successfully by central administration UI. According to my requirement I have to get and save all users info to list in my appplication. After started synchronization It was showing 1200+ number of user profiles but when i browse the below rest api url it showing 89(rowCount) only. Can anyone suggest why i'm unable to get all user profiles?




    When I try below , its showing the accounts that who have permissions to access my site.


    Wednesday, November 4, 2015 12:45 PM


  • Hi Again Flying Hope

    there is a way 

    you can get benefit from 2 methods in the UserProfileService 
    1) GetUserProfileCount 
    2) GetUserProfileByIndex

    and use the below code

    UserProfileService service = new UserProfileService();
    service.Credentials = System.Net.CredentialCache.DefaultCredentials;
    int countProfile = (int)service.GetUserProfileCount();
    for (int i = 0; i < countProfile; i++)
    //Write your code to Import to the list
    Thursday, November 5, 2015 4:59 AM