统计文件夹数量 丿记性不太好丶 默认分类 2025-12-25 95 次浏览 0 次点赞 ``` # 连接到Exchange Online PowerShell Connect-ExchangeOnline -UserPrincipalName admin@example.com # 获取指定用户邮箱文件夹统计信息 Get-MailboxFolderStatistics -Identity xxx | fl name,FolderPath # 输出每个文件夹的名称和邮件数量 $folderStats | ForEach-Object { $folderName = $_.FolderPath.Replace("/", "\") $itemCount = $_.ItemCount Write-Output "文件夹: $folderName, 邮件数量: $itemCount" } Get-MailboxFolderStatistics -Identity xxx |Where-Object { $_.VisibleItemsInFolder -gt 0 } | Sort-Object FolderPath| fl name,FolderPath,VisibleItemsInFolder # 断开连接 Disconnect-ExchangeOnline -Confirm:$false ``` 点赞 0
楼主残忍的关闭了评论