Link to home
Create AccountLog in
Avatar of Scotch Tech
Scotch TechFlag for United States of America

asked on

Need a powershell script

I have a script that will pull info for 1 mailbox. I need it for ALL mailboxes:


$mailbox1=get-mailbox mailbox1
Get-MailboxFolderStatistics $mailbox1 | ? {$_.folderpath -like "*inbox/*" -and $_.date -gt (Get-Date).AddDays(-2) } | select $Mailbox1.name,folderpath



Avatar of Amit
Amit
Flag of India image

use Get-Content and call a input file like .txt

or

$All = Get-Mailbox -ResultSize Unlimited
$All | foreach {Get-MailboxFolderStatistics -Identity $_.Identity -FolderScope Inbox | Format-Table Identity,ItemsInFolderAndSubfolders,FolderAndSubfolderSize -AutoSize}

Refer: office-docs-powershell/Get-MailboxFolderStatistics.md at master · MicrosoftDocs/office-docs-powershell · GitHub 
ASKER CERTIFIED SOLUTION
Avatar of Scotch Tech
Scotch Tech
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer