搜索邮箱命令无法识别 Exchange 2010 sp1 powershell
有谁知道为什么此命令在 Exchange 2010 SP1 中无法识别:
Search-Mailbox -Identity "April Stewart" -SearchQuery 'Subject:"Your bank statement"' -DeleteContent
Does anybody know why this command is not recognized in Exchange 2010 SP1:
Search-Mailbox -Identity "April Stewart" -SearchQuery 'Subject:"Your bank statement"' -DeleteContent
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
出现此问题的原因是您的帐户不是
Discovery Management
角色的成员。由于您的帐户没有执行搜索的权限,因此Powershell
不会导入Search-Mailbox
cmdlet。在
ECP
中,将帐户添加到此角色,然后关闭并重新启动Powershell
会话。This problem happens because your account is not a member of the
Discovery Management
role. Since your account does not have permission to perform searches,Powershell
does not import theSearch-Mailbox
cmdlet.In
ECP
, add the account to this role, then close and restart yourPowershell
session.您是从 Exchange 命令行管理程序运行此程序吗?如果您从常规 powershell 实例运行,您是否记得导入该模块?运行
get-module
以查找交换模块的名称,然后运行 import-module
以使命令可用。Are you running this from the Exchange Management Shell? If you're running from a regular powershell instance, did you remember to import the module? Run
get-module
to find the name of the exchange module, then runimport-module <modulename>
to make the commands available.我使用以下方法来解决该问题:
http://www.techieshelp.com/delete-mail-from-multiple-邮箱/
I used the following to fix the problem:
http://www.techieshelp.com/delete-mail-from-multiple-mailboxes/
创建“邮箱导入导出管理”角色组并将自己授予成员身份。
重新运行搜索命令,它就会起作用。
要创建角色组,我们需要运行以下命令:
New-RoleGroup "Mailbox Import-Export Management" -Roles "Mailbox Import Export"
添加用户可以通过运行以下命令来完成:
Add-RoleGroupMember“邮箱导入导出管理”-Member
http://blogs.technet.com/b/nawar/archive/2010/06/24/permissions-to-import-or-export-mailbox -data-in-exchange-2010.aspx
Create "Mailbox Import-Export Management" role group and grant yourself as a member.
Rerun Search commands and it will work.
To create the role group we need to run the following:
New-RoleGroup "Mailbox Import-Export Management" -Roles "Mailbox Import Export"
Adding a user can be done by running the following:
Add-RoleGroupMember "Mailbox Import-Export Management" -Member
http://blogs.technet.com/b/nawar/archive/2010/06/24/permissions-to-import-or-export-mailbox-data-in-exchange-2010.aspx