Hi,
I'm trying to run this command (exchange 2013), delete mails that are older then 30 days:
[int]$numberOfDays=30
[DateTime]$date=[DateTime]::Now.Subtract([TimeSpan]::FromDays($numberOfDays))
$m is the mailbox identity.
$date is the date ,that mails that older or equal to $date I want to delete.
I get this error:
Search-Mailbox : Could not load file or assembly 'Microsoft.Ceres.NlpBase.RichTypes, Version=16.0.0.0, Culture=neutral, PublicKeyToken
=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
At line:1 char:27
+ Get-Mailbox -Identity $m |Search-Mailbox -SearchQuery {(Received -ge $date) } -D ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Search-Mailbox], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.Exchange.Management.Tasks.SearchMailbox