Usage
m365 purview retentionevent add [options]
Description
Create a retention event
Options
| Option |
Description |
-n, --displayName <displayName> |
The display name of the event |
-e, --eventTypeName [eventTypeName] |
Name of the event type associated with the event. Specify either eventTypeId or eventTypeName but not both. |
-i, --eventTypeId [eventTypeId] |
Id of the event type associated with the event. Specify either eventTypeId or eventTypeName but not both. |
-d, --description [description] |
A description for the event |
--triggerDateTime [triggerDateTime] |
Optional time when the event should be triggered. |
-a, --assetIds [assetIds |
The Asset IDs for items in SharePoint and OneDrive that are related to this event. Only items that have labels associated with the event type you chose will be retained. Specify assetIds and/or keywords, but at least one. |
-k, --keywords [keywords] |
The keywords for items in Exchange that are related to this event. Only items that have labels associated with the event type you chose will be retained. Specify assetIds and/or keywords, but at least one. |
Examples
Create a retention event to start retention at the end of 2022 for all employee documents that have been labeled and have the Asset ID EmployeeNr1234
m365 purview retentionevent add --displayName 'Employee information expiration' --description 'Employee documents expired due to offboarding' --eventType 'CustomRetentionTime' --triggerDateTime '2022-12-31' --assetIds 'ComplianceAssetId:EmployeeNr1234'
Additional Info
The following Graph endpoint can be used:
https://graph.microsoft.com/beta/security/triggers/retentionEvents
More information
--assetIds will map to an item in de eventQueries array of type 'files'.
--keywords will map to an item in de eventQueries array of type 'messages'.
https://learn.microsoft.com/en-us/graph/api/resources/security-eventqueries?view=graph-rest-beta
Beta notice
The Graph endpoint that's used is in beta, so we should add a beta notice to the docs.
More information
This section should be included in the documentation
This command is part of a series of commands that have to do with event-based retention. Event-based retention is about starting a retention period when a specific event occurs, instead of the moment a document was labeled or created.
Read more on event-based retention here
Usage
m365 purview retentionevent add [options]
Description
Create a retention event
Options
-n, --displayName <displayName>-e, --eventTypeName [eventTypeName]eventTypeIdoreventTypeNamebut not both.-i, --eventTypeId [eventTypeId]eventTypeIdoreventTypeNamebut not both.-d, --description [description]--triggerDateTime [triggerDateTime]-a, --assetIds [assetIdsassetIdsand/orkeywords, but at least one.-k, --keywords [keywords]assetIdsand/orkeywords, but at least one.Examples
Create a retention event to start retention at the end of 2022 for all employee documents that have been labeled and have the Asset ID EmployeeNr1234
Additional Info
The following Graph endpoint can be used:
https://graph.microsoft.com/beta/security/triggers/retentionEvents
More information
--assetIdswill map to an item in deeventQueriesarray of type 'files'.--keywordswill map to an item in deeventQueriesarray of type 'messages'.https://learn.microsoft.com/en-us/graph/api/resources/security-eventqueries?view=graph-rest-beta
Beta notice
The Graph endpoint that's used is in beta, so we should add a beta notice to the docs.
More information
This section should be included in the documentation
This command is part of a series of commands that have to do with event-based retention. Event-based retention is about starting a retention period when a specific event occurs, instead of the moment a document was labeled or created.
Read more on event-based retention here