【问题标题】:Powershell get-mailboxfolderstatistics multiple foldersPowershell get-mailboxfolderstatistics 多个文件夹
【发布时间】:2014-04-17 18:44:57
【问题描述】:

我有这个脚本。希望在输出中包含、删除的项目、发送的项目和草稿。

包含它的最佳方式是什么?

谢谢

Get-MailboxFolderStatistics myuserename -FolderScope Inbox | Where {$_.FolderPath -eq "/Inbox"}

【问题讨论】:

    标签: powershell scripting exchange-server powershell-2.0


    【解决方案1】:

    我知道的最简单的方法是一次过滤多个文件夹是使用 -match 和正则表达式交替:

    Get-MailboxFolderStatistics myuserename |
     Where {$_.FolderPath -match  '/Inbox|/Deleted Items|/Sent Items|/Drafts'}
    

    【讨论】:

      【解决方案2】:

      get-mailboxfolderstatistics myusername | {$_.name -match "收件箱|已删除|已发送|日历|草稿"} |排序对象名称 | ft 名称、FolderPath、ItemsInFolder、FolderSize -auto

      【讨论】:

        猜你喜欢
        • 2021-11-28
        • 2014-02-19
        • 2016-10-26
        • 2019-08-26
        • 2013-11-19
        • 2022-01-21
        • 1970-01-01
        • 1970-01-01
        • 2015-12-25
        相关资源
        最近更新 更多