Forum Discussion
Kessy Similien
Sep 25, 2016Copper Contributor
How to get a list of all users in Office365 tenant
I have a custom form inside SharePoint online. I've been asked to create a dropdown with the first name + last name of all users in my Office 365 tenant.
The only way I can think to get that information client side is Microsoft Graph but I'm having a really hard time finding simple examples that show how to use ADAL.js and Graph. All the examples I'm seeing are using Angular, NodeJS, .NET or other platforms when I just want to do simple jQuery ajax calls to Graph and parse the results into an array.
Can someone point me in the right direction
Have you seen this example: http://paulryan.com.au/2015/unified-api-adal/?
Regards
5 Replies
- Dean_GrossSilver ContributorHow did you create the form? are you using a SP list? have you seen the Office UI Fabric People Picker, http://dev.office.com/fabric#/components/peoplepicker?
- Kessy SimilienCopper ContributorHey Dean,
The data is stored in a SP List but the form is all HTML. The people picker is great for the UI but I still need to be able to pull all the users in the tenant. Fabric UI won't get the data for you, just present it.- Dean_GrossSilver Contributorhave you seen this sample, https://github.com/OfficeDev/PnP/tree/07e5a1380418223952b94f32a7389b19182f5346/Components/Core.PeoplePicker
Have you seen this example: http://paulryan.com.au/2015/unified-api-adal/?
Regards
- Kessy SimilienCopper ContributorReading through it now. I love how he says "I failed to find a simple example of how to achieve this, my search results often filled with examples of calling the APIs from server-side code or else utilising the Angular.js framework", that was exactly my experience.