PlaceDevice.ReadWrite.All
Allows the app to read and write all workplace devices, without a signed-in user.
Permission Details
Read and write all workplace devices
Allows the app to read and write all workplace devices, without a signed-in user.
2d510721-5c4e-43cd-bfdb-ac0f8819fb92
Read and write all workplace devices
Allows the app to read and write all workplace devices, on behalf of the signed-in user.
eafd6a71-e95a-4f8a-bb6e-fb84ab7fbd9e
Properties
Properties is shown from beta metadata because a stable v1.0 schema is not available for this resource mapping.
| Property | Type | Description |
|---|---|---|
sensorDevices |
workplaceSensorDevice collection |
A collection of sensor devices. |
JSON Representation
JSON representation is shown from beta metadata because a stable v1.0 schema is not available for this resource mapping.
{
"@odata.type": "#microsoft.graph.workplace"
}
Relationships
Relationships is shown from beta metadata because a stable v1.0 schema is not available for this resource mapping.
| Relationship | Type | Description |
|---|---|---|
sensorDevices |
workplaceSensorDevice collection |
A collection of sensor devices. |
Graph Methods
Microsoft Graph v1.0 endpoints are mapped directly from refreshed Microsoft Learn permissions tables.
No API methods available for this version.
Microsoft Graph beta endpoints are mapped directly from refreshed Microsoft Learn permissions tables.
Microsoft Graph PowerShell v1.0 commands are not available from refreshed Microsoft Learn PowerShell snippets for this permission.
No deterministic PowerShell command map is available for this permission.
Browse PowerShell docsMicrosoft Graph PowerShell beta commands are not available from refreshed Microsoft Learn PowerShell snippets for this permission.
No deterministic PowerShell command map is available for this permission.
Browse PowerShell docsCode Examples
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new WorkplaceSensorDevice
{
DeviceId = "contoso_9D6816",
DisplayName = "Contoso 9D6816 Device",
Description = "Contoso 9D6816 Device",
MacAddress = "00:0A:95:9D:68:16",
Manufacturer = "Contoso",
IpV4Address = "192.168.1.100",
IpV6Address = "2001:db8::ff00:42:8329",
PlaceId = "acfa3bc0-2b83-425b-8910-84a0250e9671",
Tags = new List<string>
{
"Building A",
"Floor 3",
"Room 301",
"Conference Room",
},
Sensors = new List<WorkplaceSensor>
{
new WorkplaceSensor
{
SensorType = WorkplaceSensorType.Occupancy,
},
new WorkplaceSensor
{
SensorType = WorkplaceSensorType.PeopleCount,
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Workplace.SensorDevices.PostAsync(requestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const workplaceSensorDevice = {
deviceId: 'contoso_9D6816',
displayName: 'Contoso 9D6816 Device',
description: 'Contoso 9D6816 Device',
macAddress: '00:0A:95:9D:68:16',
manufacturer: 'Contoso',
ipV4Address: '192.168.1.100',
ipV6Address: '2001:db8::ff00:42:8329',
placeId: 'acfa3bc0-2b83-425b-8910-84a0250e9671',
tags: [
'Building A',
'Floor 3',
'Room 301',
'Conference Room'
],
sensors: [
{
sensorType: 'occupancy'
},
{
sensorType: 'peopleCount'
}
]
};
await client.api('/workplace/sensorDevices')
.version('beta')
.post(workplaceSensorDevice);
Connect-MgGraph -Scopes "PlaceDevice.ReadWrite.All"
Invoke-MgGraphRequest -Method GET -Uri "https://graph.microsoft.com/v1.0/workplace/sensorDevices"
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.workplace_sensor_device import WorkplaceSensorDevice
from msgraph_beta.generated.models.workplace_sensor import WorkplaceSensor
from msgraph_beta.generated.models.workplace_sensor_type import WorkplaceSensorType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = WorkplaceSensorDevice(
device_id = "contoso_9D6816",
display_name = "Contoso 9D6816 Device",
description = "Contoso 9D6816 Device",
mac_address = "00:0A:95:9D:68:16",
manufacturer = "Contoso",
ip_v4_address = "192.168.1.100",
ip_v6_address = "2001:db8::ff00:42:8329",
place_id = "acfa3bc0-2b83-425b-8910-84a0250e9671",
tags = [
"Building A",
"Floor 3",
"Room 301",
"Conference Room",
],
sensors = [
WorkplaceSensor(
sensor_type = WorkplaceSensorType.Occupancy,
),
WorkplaceSensor(
sensor_type = WorkplaceSensorType.PeopleCount,
),
],
)
result = await graph_client.workplace.sensor_devices.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 or delegated permissions and search for PlaceDevice.ReadWrite.All
Grant Admin Consent
Application permissions always require admin consent.