Microsoft Exchange Online Mailbox | MailBox Usage Details

Swapnil Dave 41 Reputation points
2021-09-20T10:00:45.927+00:00

The user after being deleted (soft deleted) appears in the response of this api getMailboxUsageDetail. Why, this user is appearing in the api response as this user is deleted.

Also, how to know if the user is soft deleted or not.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,705 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Danstan Onyango 3,741 Reputation points Microsoft Employee
    2021-09-20T17:38:44.08+00:00

    Why, this user is appearing in the API response as this user is deleted.

    getMailboxUsageDetail is a usage report and once reports are generated for a period they are not deleted even when the user are deleted because they are records of usage regardless of if the user still exists or not.

    Also, how to know if the user is soft deleted or not.

    When a user is soft deleted, the user will be accessible under List deleted items . To check that you can do Get deleted item which returns 404 when the user is either permanently deleted or is not on soft deleted state. For example

    GET https://graph.microsoft.com/v1.0/directory/deletedItems/microsoft.graph.user/user-id  
      
    {  
        "error": {  
            "code": "Request_ResourceNotFound",  
            "message": "Resource 'user-id' does not exist or one of its queried reference-property objects are not present.",  
            "innerError": {...}  
        }  
    }  
    
    0 comments No comments