> For the complete documentation index, see [llms.txt](https://docs.nuvens.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nuvens.cloud/admin/configuration-section/settings/enterprise/microsoft-graph-entra-settings.md).

# Microsoft Graph (Entra) Settings

The Microsoft Graph (Entra) Settings section allows you to integrate WSM with Microsoft Entra ID using the Microsoft Graph API for directory synchronisation and entitlement validation.

<figure><img src="/files/DMztlID0EWoYwP60tWcD" alt=""><figcaption></figcaption></figure>

This integration enables the portal to:

* Retrieve user and group information
* Synchronise Entra ID groups
* Validate group memberships
* Support automated entitlement workflows
* Optionally retire devices from Microsoft Intune

The integration authenticates using an Entra-registered application configured with **Application API Permissions**.

### Required API Permissions (Application)

<table data-header-hidden><thead><tr><th width="265"></th><th width="201"></th></tr></thead><tbody><tr><td>Permission</td><td>Type</td></tr><tr><td>GroupMember.Read.All</td><td>Application</td></tr><tr><td>Group.Read.All</td><td>Application</td></tr><tr><td>User.Read.All</td><td>Application</td></tr><tr><td>Directory.Read.All</td><td>Application</td></tr></tbody></table>

These permissions require:

* Tenant-wide Admin Consent
* Potential Security Team approval depending on enterprise governance processes

### Important

Do not reuse the OIDC App Registration for Microsoft Graph synchronisation.

The Graph integration uses:

* OAuth2 Client Credentials Flow
* Background service authentication
* Server-to-server communication

and therefore requires **Application permissions**, not Delegated permissions.

### Intune Integration

If enabled, WSM can also integrate with Microsoft Intune to support device lifecycle operations such as:

* Retire Device

This requires:

* Additional Microsoft Graph permissions
* The relevant checkbox enabled within the WSM configuration

## Verifying Microsoft Graph Connectivity

Administrators can validate Microsoft Graph connectivity and group visibility directly from the WSM server.

This can be done by:

1. Opening an RDP session to the WSM server
2. Running the PowerShell validation script
3. Validating the returned group membership data

WSM also provides an internal validation endpoint:

```
http://localhost/test/FetchAllEntraGroups
```

This endpoint can be used to validate:

* Entra ID connectivity
* OAuth token acquisition
* Group enumeration
* Microsoft Graph permissions

<figure><img src="/files/zc2yy0b81eSF2TlqNsMF" alt=""><figcaption></figcaption></figure>

### Example Validation Script

Copy this content, modify the "Variables" and save it as, per example, "**Get-GraphGroupMembers.ps1**". Run it from a PowerShell session directly on a WorkSpaces Manager appliance:

<figure><img src="/files/PUX8R1MRGsqT6tQd97vf" alt=""><figcaption></figcaption></figure>

```
# Variables
$TenantId     = "<TENANT_ID>"
$ClientId     = "<APP_ID>"
$ClientSecret = "<CLIENT_SECRET_VALUE>"
$GroupName    = "<SECURITY_GROUP_NAME>"

# Get OAuth token
$Body = @{
    client_id     = $ClientId
    scope         = "https://graph.microsoft.com/.default"
    client_secret = $ClientSecret
    grant_type    = "client_credentials"
}

$TokenResponse = Invoke-RestMethod `
    -Method Post `
    -Uri "https://login.microsoftonline.com/$TenantId/oauth2/v2.0/token" `
    -Body $Body `
    -ContentType "application/x-www-form-urlencoded"

$AccessToken = $TokenResponse.access_token

$Headers = @{
    Authorization = "Bearer $AccessToken"
}

# Search group
$GroupSearchUri = "https://graph.microsoft.com/v1.0/groups?`$filter=displayName eq '$GroupName'"

$GroupResponse = Invoke-RestMethod `
    -Method Get `
    -Uri $GroupSearchUri `
    -Headers $Headers

$GroupId = $GroupResponse.value[0].id

Write-Host "Group ID: $GroupId"

# Get group members
$MembersUri = "https://graph.microsoft.com/v1.0/groups/$GroupId/transitiveMembers?`$select=displayName,userPrincipalName,mail"

$MembersResponse = Invoke-RestMethod `
    -Method Get `
    -Uri $MembersUri `
    -Headers $Headers

$MembersResponse.value |
    Select-Object displayName,userPrincipalName,mail |
    Format-Table -AutoSize
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.nuvens.cloud/admin/configuration-section/settings/enterprise/microsoft-graph-entra-settings.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
