【问题标题】:Powershell list permissions for top of information store for all mailboxes in a specific object unit特定对象单元中所有邮箱的信息存储顶部的 Powershell 列表权限
【发布时间】:2017-04-18 17:10:58
【问题描述】:

需要建议如何循环以下代码以列出特定对象单元中的所有用户权限:

 Get-MailboxFolderPermission -Identity username:\

应该有这样的东西,但需要正确的方法来在这里放置一个循环:

 Get-Mailbox -ResultSize Unlimited -OrganizationalUnit "ou=test,ou=internal,ou=net,dc=local,dc=net"  | Get-MailboxFolderPermission -Identity username:\ \\networkshare\mailboxpermissions.csv

【问题讨论】:

    标签: powershell


    【解决方案1】:

    您只需在识别用户后使用 foreach 循环即可。

    Get-Mailbox -ResultSize Unlimited | foreach { 
       Get-MailboxFolderPermission -Identity $_.Id 
    }
    

    如果需要,请附加 | Export-CSV x.csv。但是,您可能需要为此创建自定义对象。见this helpful thread

    【讨论】:

    • 谢谢!我遇到了以下代码,但可能由于某些语法问题而无法正常工作,需要建议。 Get-Mailbox -ResultSize Unlimited -OrganizationalUnit "ou=test,ou=internal,ou=net,dc=local,dc=net" | foreach { Get-MailboxFolderPermission -Identity $_.id }| Export-Csv \\networkshare\mailboxpermissions.csv 我想我需要以另一种方式指定身份,还需要指定我需要信息存储顶部的权限。对于单个脚本,我只需输入用户名:\
    • 我忘了补充说那个错误信息是'Cannot bing argument to parameter'Identity',因为它是空的
    • 所以我做了一些研究,显然你可以直接通过管道发送到Get-MailboxFolderPermission。所以首先,确保Get-Mailbox -ResultSize Unlimited -OrganizationalUnit "ou=test,ou=internal,ou=net,dc=local,dc=net" 正在返回结果(完整性检查?)。然后,运行Get-Mailbox -ResultSize Unlimited -OrganizationalUnit "ou=test,ou=internal,ou=net,dc=local,dc=net" | Get-MailboxFolderPermission。让我知道它是如何工作的。
    猜你喜欢
    • 2013-08-15
    • 2015-09-07
    • 2019-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-20
    • 1970-01-01
    相关资源
    最近更新 更多