Skip to content

Instantly share code, notes, and snippets.

@Trimad
Last active December 3, 2021 17:42
Show Gist options
  • Save Trimad/b2a3e1c943a4b462597cac6165b1b7c3 to your computer and use it in GitHub Desktop.
Save Trimad/b2a3e1c943a4b462597cac6165b1b7c3 to your computer and use it in GitHub Desktop.
# Get connected to Exchage Online Management
Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName <UPN>
#Search the RSS folders of all OWA users
$All = Get-Mailbox -ResultSize Unlimited
$Result=@()
$All | foreach {
$obj =Get-MailboxFolderStatistics -Identity $_.Identity | Where {$_.Identity -match "RSS"} | select Identity,ItemsInFolderAndSubfolders,FolderAndSubfolderSize,LastModifiedTime
Write-Output $obj
$Result += $obj
}
$Result | Export-CSV "output.csv" -noType
#Search the rules of all OWA users
#This dumps all rules for all users into a .csv file. You can search the CSV for things like "RSS" or "move the message to folder" to quickly identify malicous rules.
$All = Get-Mailbox -ResultSize Unlimited
$Result=@()
$All | foreach {
$obj =Get-InboxRule -Mailbox $_.Identity
Write-Output $obj
$Result += $obj
}
$Result | Export-CSV "output.csv" -noType
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment