首页 > 解决方案 > Office 364 审核日志:Search-UnifiedAuditLog 未被识别为 cmdlet 的名称

问题描述

我试图通过 PowerShell 从 Office 365 读取 AuditLogs,因此我们可以分析使用情况并自动更新数据:

# Create/Import remote session (no errors, no warnings)
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -DisableNameChecking -AllowClobber

Search-UnifiedAuditLog -StartDate $StartDate -EndDate $EndDate -ResultSize 5000 # <- Fails here

错误:

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.

那个 cmdlet 是被删除了还是我错过了什么?

如果这不再有效,是否有另一种方法可以自动获取审核日志?

标签: powershellautomationoffice365

解决方案


我似乎缺少一些对 Exchange 的访问权限,这意味着某些命令对我来说是隐藏的。


推荐阅读