The following privileges/roles are required in the Entra ID tenant and Exchange Online instance:
-
Entra ID tenant:
Global Readerrole. -
Exchange Online environment:
View-Only Audit Logsrole. This role is granted by default to theCompliance ManagementandOrganization Managementrole groups (to which members can be assigned). Members can be assigned to the aforementioned groups through the Exchange administration portal.If the required rights are not correctly granted to the user conducting the log collection, the following error will arise:
Search-UnifiedAuditLog : The term 'Search-UnifiedAuditLog' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. -
Azure subscription (for retrieving
Azure Activity logsfor the given subscription):Log Analytics Readerrole. -
Azure DevOps organization (for retrieving
Azure DevOps Activity logsfor the given Azure DevOps organization):Auditing\View audit logpermission.
Note that accessing Entra ID logs through the MS Graph API requires at least
one user with a Microsoft Entra ID P1 or Microsoft Entra ID P2 license
(formerly Azure AD Premium P1 / P2). These licenses can be included in
other license plans, such as Microsoft 365 E3/E5/F3. The user to which the
license is assigned does not matter.
View on GitHub