If anyone else is reading this post, the logs started magically being correctly purged 3 days after I posted for help. I'm closing the issue, but I'm not very assured, since magic is something I don't like in IT.
Let me share the Powershell script I created as a workaround so I didn't run out of space meanwhile
The script:
- Checks if The MailboxDatabase is Mounted
- Enables Circular-Logging
- Dismounts the MailboxDatabase
- Mounts the MailboxDatabase
The logs get purged
- Disables Circular-Logging
- Dismounts the MailboxDatabase
- Mounts the MailboxDatabase
`
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
################# Functions ###############
Function MandaMail{
Param ( [string]$assunto,[string]$texto )
Send-MailMessage -To “<recipient@domain.com>” -From “<sender@domain.com>” -Subject $assunto -Body $texto -SmtpServer “smtp.server.domain”
}
Function IsMounted{
Param ( [string]$mdb )
return [System.Convert]::ToBoolean($(Get-MailboxDatabase $mdb -Status | foreach { $_.Mounted}))
}
Function ReiniciaMDB{
Param ( [string]$mdb )
Start-Sleep -Seconds 5
Write-Host " ...vamos desmontar a Mailboxdatabase:"$mdb
Dismount-Database -Identity $mdb –confirm:$false
Start-Sleep -Seconds 10
Write-Host " ...confirmar se desmontou... "
if (IsMounted($mdb)) {
Write-Host " ...ERRO ao desmontar -> return False "
return $false }
Else {
Write-Host " ...ok, desmontou."
Write-Host " ...vamos montar a Mailboxdatabase:"$mdb
Mount-Database $mdb
Start-Sleep -Seconds 5
Write-Host " ...confirmar se montou..."
if (IsMounted($mdb)) {
Write-Host " ...ok. montou"
return $true }
Else {
Write-Host " ...ERRO ao montar -> return False "
MandaMail -assunto "Exchange | PurgeTransLogs | ERRO ao montar:"$mdb -texto "."
return $false}
}
}
Function LimpaTransLogs{
Param ( [string]$mdb )
if (IsMounted($mdb)) {
Write-Host "...a MDB "$mdb" esta montada. /n ...activar o circular logging..: "
Set-MailboxDatabase -Identity $mdb -CircularloggingEnabled:$true
Write-Host "...reiniciar a MBD run1... "
If (ReiniciaMDB($mdb)) {
Write-Host "...reiniciou com SUCESSO. /n ...desactivar o circular logging..: "
Set-MailboxDatabase -Identity $mdb -CircularloggingEnabled:$false
Write-Host "...reiniciar a MBD run2..: "
If (ReiniciaMDB($mdb)) {
Write-Host "...reiniciou com SUCESSO."
MandaMail -assunto "Exchange | PurgeTransLogs | SUCESSO " -texto "."
Write-Host "...FIM!"
return $true}
Else {
Write-Host "...algo não correu bem :("
return $false
}
}
Else { Write-Host "...nao reiniciou a MBD run1" }
}
Else {
Write-Host "...A MDB "$mdb" nao estava montada"
MandaMail -assunto "Exchange | PurgeTransLogs | ERRO: nao estava montada " -texto "."
}
}
#####################################################################
LimpaTransLogs("MailboxDatabase_01")
LimpaTransLogs("MailboxDatabase_02")