$c = Get-MailboxAutoReplyConfiguration -Identity "Anastasia.Grafova@remind.ru"
function Show-AutoReplyText($Html) {
$Text = $Html -replace '(?i)<br\s*/?>', "`r`n"
$Text = $Text -replace '(?i)</p>', "`r`n"
$Text = $Text -replace '<[^>]+>', ''
[System.Net.WebUtility]::HtmlDecode($Text).Trim()
}
Write-Host "`n===== ВНУТРЕННИЙ АВТООТВЕТ =====" -ForegroundColor Cyan
Show-AutoReplyText $c.InternalMessage
Write-Host "`n===== ВНЕШНИЙ АВТООТВЕТ =====" -ForegroundColor Cyan
Show-AutoReplyText $c.ExternalMessage
Write-Host "`n===== СОСТОЯНИЕ =====" -ForegroundColor Cyan
$c | Format-List AutoReplyState,ExternalAudience