【Publisher】Get a user list using Microsoft Graph

This time, I'm going to use Microsoft Graph from the [Sharperlight](https://sharperlight.jp/) publisher to get a user list of my company.
## Start Publisher ##
Start Publisher. Select from the Sharperlight application menu.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/ef25aa61-e288-19be-8a60-b90fc484da50.png)
## Starting to create a new report ##
Once the publisher is up, start creating a new report with the `New` button.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/72c562f5-6421-2ff6-8eec-1327dceb4c74.png)
In the New Report Definition dialog that opens, enter the **Group**, **Code** and **Title**.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/cc33dc38-f8ae-ecb8-ff50-a0bde1051df6.png)
## Defining Query ##
Start defining the query with the `Edit Query` button. Query Builder starts.
#### Mode and Product ####
In the Query Builder, select <font color="Red">Summary Report</font> for **Mode** and <font color="Red">System</font> for **Product**.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/2d9dae8a-b5c5-37ea-6e21-c95d45c63487.png)
#### Table ####
For **Table**, set <font color="Red">Web Page Table, CSV, JSON, XML or OData</font>.
A set of filters related to the selected table value will be generated and displayed.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/3e350554-614d-1310-41f0-be9cd861607a.png)
#### URL Link ####
Copy the URL for gettong <font color="Red">all users in the organization</font> from the **Microsoft Graph Explorer** and paste it into the **URL Link** filter value field in the query builder.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/087cea27-3824-130c-ccc9-7f81aec367fc.png)
Paste the URL.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/6443218f-395d-c648-93fe-d06dfaf5d0f6.png)
#### Authentication Type ####
Authentication is required.
Click the Search button for the **Authentication Type** filter. Enter the details in the authentication dialog that opens.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/5dab3d0b-4fa9-c0c9-190b-71efaef69f7c.png)
In the authentication dialog, first select the type. Select <font color="Red">\<Microsoft Azure Graph></font> from the drop-down list.
Enter the necessary information in \<Microsoft Azure Graph> and perform an authentication test with the `Test` button.
It's also a good idea to save your settings for reuse with the `Add` button.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/2a9cc879-78f2-212c-88b8-2a81758b5f4d.png)
If the authentication is successful, save it with the `OK` button.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/c9351ffe-c0e3-66db-ba98-c3bca12e9498.png)
Once the **Authentication Type** has been determined, a list of items that can be acquired will be displayed in the `Selection` area.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/a058db77-0439-eee2-0d47-a2a593b112ac.png)
#### Setting and previewing query output items ####
Set the fetchable items in the `output` area. Try running the query with the `Preview` button.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/1e9eff8a-4c0b-e417-5125-e5e383bb8039.png)
A list of users will be returned.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/d96c790a-99fe-653c-bc0c-3e046db034e8.png)
If you can preview the data, save the query with the `OK` button.
Go to the Options tab and **uncheck** the Enable Prompts checkbox.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/d48fb88d-94e0-624e-e828-5d96faa981ff.png)
Save the report with the `OK` button.
## View as web report ##
The saved report will be displayed in the publisher's report list, so select **View Report** from the right-click menu.
Of course, don't forget to start the Sharperlight service.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/c71b7fb6-8736-653a-b2b8-71b847c6f4a2.png)
Your browser should display the report like this.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/d9a9c274-0a17-2692-4a34-ae23d09e7794.png)

Depending on your company's settings for user security on the Microsoft Azure side, you may be able to query other information like this as well.