【问题标题】:Exchange Powershell attempting to gather all mailboxes that have send as permissions grantedExchange Powershell 尝试收集所有已授予发送权限的邮箱
【发布时间】:2017-12-29 23:06:07
【问题描述】:

我正在从本地 Exchange 2010/2013 迁移到 Office 365 Exchange Online。我正在尝试收集所有已授予发送权限的用户类型和共享类型邮箱的报告;以及被授予权限的邮件用户的名称。我正在使用的代码如下。

#Get-Mailbox -RecipientTypeDetails SharedMailbox,usermailbox -resultsize unlimited | Get-ADPermission | where {($_.ExtendedRights -like "*Send-As*") -and ($_.IsInherited -eq $false) -and -not (($_.User -like "NT AUTHORITY\SELF") -or ($_.User -like "S-1-5-*") -or ($_.User -like "NT AUTHORITY\SYSTEM") -or ($_.User -like "BUILTIN\Administrators"))} | select User,identity | Export-Csv $outfile

代码似乎可以工作,但几分钟后我得到以下信息:

我尝试从 3 个不同的交换服务器运行代码,但不断收到相同错误的变体,我不知所措。我什至尝试将其限制为仅用户并且仅共享邮箱无济于事。任何建议将不胜感激。

【问题讨论】:

  • 请将错误详情添加为文本 - 而不是图像。
  • 有什么特别的原因为什么你试图把这一切都放在一个单行里?对于这样的脚本(尤其是在迁移场景中),我首先倾向于获取所有邮箱及其所有权限的完整列表(并将其保存以供将来参考),然后我通过过滤数据使用 Powershell 在本地处理此列表。

标签: powershell exchange-server-2010 exchange-server-2013


【解决方案1】:

那个特定的错误非常具体。大小配额阻碍了成功。

您可以更改尺寸,看看是否能解决您的问题。

winrm get winrm/config 

Default configuration

Config
    MaxEnvelopeSizekb = 500
    MaxTimeoutms = 60000
    MaxBatchItems = 32000
    MaxProviderRequests = 4294967295
    Client
        NetworkDelayms = 5000
        URLPrefix = wsman
...


winrm get winrm/config @{MaxEnvelopeSizekb="5000"}

更新,上面应该已经设置不get了,转置不好。

winrm set winrm/config @{MaxEnvelopeSizekb="5000"}

或 OP (CBeale) 记下的 cmd。

Set-WSManInstance -ResourceURI winrm/config -ValueSet @{MaxEnvelopeSizekb = "5000"}

【讨论】:

  • 这不太对,但给了我解决问题所需的线索。我使用的命令看起来像这样Set-WSManInstance -ResourceURI winrm/config -ValueSet @{MaxEnvelopeSizekb = "5000"}
猜你喜欢
  • 2015-09-07
  • 1970-01-01
  • 2018-12-20
  • 2023-01-20
  • 2019-10-03
  • 2010-10-04
  • 1970-01-01
  • 2012-01-19
  • 2019-06-22
相关资源
最近更新 更多