【问题标题】:Exchange PowerShell: Exporting mailbox folder AccessRightsExchange PowerShell:导出邮箱文件夹 AccessRights
【发布时间】:2017-08-01 01:15:06
【问题描述】:

使用 PowerShell,我想导出特定 OU 中用户的 Exchange 环境中的所有邮箱,其中文件夹级别的用户“默认”的 AccessRights 级别不等于“无”。为此,我使用以下命令:

$AllMailbox = Get-Mailbox -OrganizationalUnit "DNofOU" -ResultSize Unlimited 
$ResultData = foreach ($Mailbox in $AllMailbox) 
    {
        Get-MailboxFolderPermission $Mailbox | Where-Object {$_.User -Match "Default" -AND $_.AccessRights -NotMatch "None"} | Select-Object Identity,AccessRights,@{Name="Name"; Expression={$Mailbox.Name}}
    }  
$ResultData | Export-CSV -Path C:\temp\MailboxFolderPermissions.csv

但是,当运行此命令时,我收到以下错误:

无法处理参数“身份”的参数转换。无法转换“Deserialized.Microsoft.Exc”类型的“DisplayNameOfMailbox”值 hange.Data.Directory.Management.Mailbox”以键入“Microsoft.Exchange.Configuration.Tasks.MailboxFolderIdParameter”。 + CategoryInfo : InvalidData: (:) [Get-MailboxFolderPermission], ParameterBindin...mationException + FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-MailboxFolderPermission + PSComputerName : FQDNofExchangeServer

该环境基于 Windows Server 2008 R2 服务器上的 Exchange 2010 和 PowerShell 版本 2.0。当远程连接到 Exchange 服务器时,也可以从具有 PowerShell 版本 4.0 的 Windows Server 2012 R2 服务器执行此操作。

【问题讨论】:

    标签: powershell exchange-server windows-server


    【解决方案1】:

    对我来说,使用对象的完整规范名称效果更好。 像这样:

    $mailboxArray = Get-Mailbox -OrganizationalUnit "example.com/Accounts" -ResultSize Unlimited
    

    我不确定这是否已经找到答案,但我想就如何获取组织单位中的所有邮箱提供我的意见。

    【讨论】:

      猜你喜欢
      • 2019-02-25
      • 1970-01-01
      • 2018-05-25
      • 2014-02-28
      • 1970-01-01
      • 2015-06-11
      • 2012-11-27
      • 2012-11-26
      • 1970-01-01
      相关资源
      最近更新 更多