首页 > 解决方案 > Powershell搜索数十个365共享邮箱

问题描述

我试图想出一种方法,我可以编写脚本来搜索大约 40 个我具有完全访问权限的共享邮箱,例如特定字符串“subjet:hello”我正在创建会话:

$O365Cred = Get-Credential
$O365Session = New-PSSession –ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $O365Cred -Authentication Basic -AllowRedirection
Set-ExecutionPolicy RemoteSigned -force
Import-PSSession $O365Session

Search-Mailbox -Identity "one.of.them@cbla.onmicrosoft.com" -SearchQuery 'Subject:hello' 

我遇到错误:需要目标邮箱或 .pst 文件路径。

我不知道这里发生了什么,我需要将所有共享邮箱下载为 pst 吗?

任何帮助将不胜感激,因为谷歌对我帮助不大

标签: powershellsearch

解决方案


推荐阅读