3
Re: option for purging of message archive data
Question asked by Hemen Shah - April 8 at 6:26 AM
Unanswered
SM Team,
 
Is it possible to have option / defined period to purge the message archive data ?
This can be domain specific or may be rule.
 
Thanks

2 Replies

Reply to Thread
0
Hemen Shah Replied
April 14 at 12:53 AM
SM team,
 
Any update on this
0
Jean-Guy Dubois Replied
April 14 at 1:20 AM
Message archive are eml files.
So you can purge with a powershell script :
 
# Change the value $oldTime in order to set a limit for files to be deleted.
$oldTime = [int]60 # 60 days
foreach ($path in Get-Content "C:\pathList.txt") {
    # Write information of what it is about to do
    Write-Host "Trying to delete files older than $oldTime days, in the folder $path" -ForegroundColor Green
    # deleting the old files
    Get-ChildItem $path -Recurse -Include "*.*" | WHERE {($_.CreationTime -le $(Get-Date).AddDays(-$oldTime))} | Remove-Item -Force -recurse

Reply to Thread