Get User Hold Policies

Update: This script has moved to the PowerShell Gallery.  All future updates will be posted at: you've ever wanted to be able to track down all of the policies and ways that a mailbox's data might be held, this mi

2,343 times
Add to favorites
Office 365
E-mail Twitter Digg Facebook
  • want to export reteand ntion holds startdate and enddate
    2 Posts | Last post January 28, 2020
    • I used this but it didn't pull the dates. Any idea?
      Get-Mailbox | where {$_.RetentionHoldEnabled -eq $true} | Select Name, StartDateForRetention, EndDateforRetention | Export-Csv C:\mine4.csv
    • Then you don't have any mailboxes with the RetentionHoldEnabled property set.
  • this PowerShell is not working for us
    2 Posts | Last post January 28, 2020
    • we keep getting 
      Get-Mailbox : The term 'Get-Mailbox' is not recognized as the name of a cmdlet, function, script file, or operable
      program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
      At line:1 char:1
      + Get-Mailbox -Resultsize Unlimited | .\Get-UserHoldPolicies.ps1
      + ~~~~~~~~~~~
          + CategoryInfo          : ObjectNotFound: (Get-Mailbox:String) [], CommandNotFoundException
          + FullyQualifiedErrorId : CommandNotFoundException
    • Looks like you're not connected to Exchange Online.  If you're trying to pipe the output of Get-Mailbox into this script, you'll need to connect to EXO first.