Presence.ReadWrite.All
Allows the app to read all presence information and write activity and availability of all users in the directory without a signed-in user. Presence information includes activity, availability, status note, calendar out-of-office message, time zone and location.
Permission Details
Read and write presence information for all users
Allows the app to read all presence information and write activity and availability of all users in the directory without a signed-in user. Presence information includes activity, availability, status note, calendar out-of-office message, time zone and location.
83cded22-8297-4ff6-a7fa-e97e9545a259
Properties
Properties is shown from stable Microsoft Graph v1.0 metadata.
| Property | Type | Description |
|---|---|---|
activity |
StringNullable |
The supplemental information to a user's availability. Possible values are available, away, beRightBack, busy, doNotDisturb, offline, outOfOffice, presenceUnknown. |
availability |
StringNullable |
The base presence information for a user. Possible values are available, away, beRightBack, busy, doNotDisturb, focusing, inACall, inAMeeting, offline, presenting, presenceUnknown. |
id |
String |
The unique identifier for the user. |
outOfOfficeSettings |
outOfOfficeSettings |
The out of office settings for a user. |
sequenceNumber |
StringRead-onlyNullable |
The lexicographically sortable String stamp that represents the version of a presence object. |
statusMessage |
presenceStatusMessage |
The presence status message of a user. |
workLocation |
userWorkLocation |
Represents the user’s aggregated work location state. |
JSON Representation
JSON representation is shown from stable Microsoft Graph v1.0 metadata.
{
"activity": "String",
"availability": "String",
"id": "String (identifier)",
"outOfOfficeSettings": {
"@odata.type": "#microsoft.graph.outOfOfficeSettings"
},
"sequenceNumber": "String",
"statusMessage": {
"@odata.type": "#microsoft.graph.presenceStatusMessage"
},
"workLocation": {
"@odata.type": "microsoft.graph.userWorkLocation"
}
}
Relationships
Relationships is shown from stable Microsoft Graph v1.0 metadata.
| Relationship | Type | Description |
|---|---|---|
statusMessage |
presenceStatusMessage |
Presence status message of a user. |
Graph Methods
Microsoft Graph v1.0 endpoints are mapped directly from refreshed Microsoft Learn permissions tables.
Microsoft Graph beta endpoints are mapped directly from refreshed Microsoft Learn permissions tables.
Microsoft Graph PowerShell v1.0 commands are mapped directly from refreshed Microsoft Learn PowerShell snippets.
Microsoft Graph PowerShell beta commands are mapped directly from refreshed Microsoft Learn PowerShell snippets.
Code Examples
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Users.Item.Presence.ClearPresence;
var requestBody = new ClearPresencePostRequestBody
{
SessionId = "22553876-f5ab-4529-bffb-cfe50aa89f87",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Users["{user-id}"].Presence.ClearPresence.PostAsync(requestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const clearPresence = {
sessionId: '22553876-f5ab-4529-bffb-cfe50aa89f87'
};
await client.api('/users/fa8bf3dc-eca7-46b7-bad1-db199b62afc3/presence/clearPresence')
.post(clearPresence);
Import-Module Microsoft.Graph.CloudCommunications
$params = @{
sessionId = "22553876-f5ab-4529-bffb-cfe50aa89f87"
}
Clear-MgUserPresence -UserId $userId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.users.item.presence.clear_presence.clear_presence_post_request_body import ClearPresencePostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ClearPresencePostRequestBody(
session_id = "22553876-f5ab-4529-bffb-cfe50aa89f87",
)
await graph_client.users.by_user_id('user-id').presence.clear_presence.post(request_body)
App Registration
Navigate to Azure Portal
Go to App registrations in Microsoft Entra admin center
Add API Permission
Select your app → API permissions → Add a permission → Microsoft Graph
Select Permission Type
Choose Application permissions and search for Presence.ReadWrite.All
Grant Admin Consent
Application permissions always require admin consent.