admin管理员组文章数量:1414908
I'm trying to create a Powershell script runbook to periodically export Purview Explorer Activity data without the need of an interactive login screen. In order to access that cmdlet (Export-ExplorerActivityData), I need to connect to the Security & Compliance Powershell. I'm using the following code to connect:
Connect-ExchangeOnline -AccessToken $accessToken -Organization "my.onmicrosoft"
The Access Token request code I'm using looks like this:
$accessToken = (Get-AzAccessToken -ResourceUrl "; -AsSecureString -ErrorAction Stop).Token
When I run this command, it returns the error UnAuthorized and I cannot access Export-ExplorerActivityData cmdlet.
According to the Microsoft documentation the runbook running this cmdlet needs to have at least Security Reader permissions. I have setup the following permissions: Runbook: Security Reader, App Compliance Automation Reader, Reader Azure Account: Owner, Security Reader Subscription: Security reader, Security Admin
I expected it to have enough permissions, but it returns an error UnAuthorized.
My Azure account has the M365 E5 Compliance and M365 E3EEA licenses active, so I can access Purview's Data Loss Prevention.
本文标签: UnAuthorized when accessing Security amp Compliance PowerShellStack Overflow
版权声明:本文标题:UnAuthorized when accessing Security & Compliance PowerShell - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745156865a2645227.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论