| title | Update protectionRuleBase |
|---|---|
| description | Update the properties of a protectionRuleBase object. |
| author | manikantsinghms |
| ms.date | 01/15/2025 |
| ms.localizationpriority | medium |
| ms.subservice | m365-backup-storage |
| doc_type | apiPageType |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Update the properties of a protectionRuleBase object. This method is only supported for the dynamic rules of exchangeProtectionPolicy and onedriveForBusinessProtectionPolicy objects. After the update is applied, the value of the status property of the protectionRuleBase object is set to updateRequested.
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
PATCH /solutions/backupRestore/oneDriveForBusinessProtectionPolicies/{oneDriveForBusinessProtectionPolicyId}/driveInclusionRules/{driveProtectionRuleId}
PATCH /solutions/backupRestore/exchangeProtectionPolicies/{exchangeProtectionPolicyId}/mailboxInclusionRules/{mailboxProtectionRuleId}| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
[!INCLUDE table-intro]
In the request body, provide a JSON representation of one of the following properties to update the protectionRuleBase object.
| Property | Type | Description |
|---|---|---|
| driveExpression | String | Contains a drive expression. For examples, see driveExpression examples. |
| mailboxExpression | String | Contains a mailbox expression. For examples, see mailboxExpression examples. |
If successful, this method returns a 200 OK response code and an updated protectionRuleBase object in the response body.
The following example shows how to update a driveInclusionRule associated with a onedriveForBusinessProtectionPolicy.
The following example shows a request.
PATCH https://graph.microsoft.com/beta/solutions/backupRestore/oneDriveForBusinessProtectionPolicies/e267a763-ca81-4a98-8c1a-f407143cffe1/driveInclusionRules/c31adc5c-b65d-4a85-8eda-976947a24124
Content-Type: application/json
{
"driveExpression": "(memberOf -any (group.id -in ['4e8e9b15-bfc8-40a2-aed0-3f65a22e2bd4']))"
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.driveProtectionRule)",
"id": "c31adc5c-b65d-4a85-8eda-976947a24124",
"status": "updateRequested",
"createdDateTime": "2025-01-15T14:42:34.5329239Z",
"lastModifiedDateTime": "2025-01-15T14:58:08.5918017Z",
"isAutoApplyEnabled": true,
"createdBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264"
},
"user": {
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e"
}
},
"lastModifiedBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264"
},
"user": {
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e"
}
},
"driveExpression": "(memberOf -any (group.id -in ['4e8e9b15-bfc8-40a2-aed0-3f65a22e2bd4']))"
}The following example shows how to update a mailboxInclusionRule associated with an exchangeProtectionPolicy.
The following example shows a request.
PATCH https://graph.microsoft.com/beta/solutions/backupRestore/exchangeProtectionPolicies/e267a763-ca81-4a98-8c1a-f407143cffe1/mailboxInclusionRules/c31adc5c-b65d-4a85-8eda-976947a24124
Content-Type: application/json
{
"mailboxExpression": "(memberOf -any (group.id -in ['c318eb4a-ea72-42bd-8f0b-d0bbf794bec7']))"
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.mailboxProtectionRule)",
"id": "c31adc5c-b65d-4a85-8eda-976947a24124",
"status": "updateRequested",
"createdBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264"
},
"user": {
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e"
}
},
"createdDateTime": "2015-06-19T12:01:03.45Z",
"lastModifiedBy": {
"application": {
"id": "1fec8e78-bce4-4aaf-ab1b-5451cc387264"
},
"user": {
"id": "845457dc-4bb2-4815-bef3-8628ebd1952e"
}
},
"lastModifiedDateTime": "2015-06-19T12:01:03.45Z",
"isAutoApplyEnabled": true,
"mailboxExpression": "(memberOf -any (group.id -in ['c318eb4a-ea72-42bd-8f0b-d0bbf794bec7']))"
}