Просмотр сообщений

В этом разделе можно просмотреть все сообщения, сделанные этим пользователем.

Просмотр сообщений

Сообщения - flaitsman

#1
Виктория тебе уже сказала, что винт сыпется (current pending sectors = 103 и reallocated event count = 15). С винтом все плохо, начни с его замены.
#2
Windows / AD рабочие папки
28 марта 2019, 16:37:59
Сертификат можно купить или поднять свой CA. Во втором случае понадобятся дополнительные телодвижения, по добавлению корневого сертификата CA в доверенные корневые центры сертификации на машинах. В домене политикой, на отдельных рабочих станциях и прочих девайсах - руками.
#3
Я так понял, что юзеры локальные, верно? Здесь галка не стоит?  :)
#4
Скрипт для чанги 2013. Чекает очередь сообщений, и если количество висящих в очереди писем больше установленных лимитов, то уведомляет по почте.

Param(
[string]$From = 'alert@domain.net'
[string]$To = 'admin@domain.net'
[string]$Server = 'mail.domain.local'
[switch]$email = $true
)
[int]$WarningLevel = 10
[int]$CriticalLevel = 20
[int]$ResultError = 0
[string]$computername=$env:computername
function Send-EmailMessage {
param([string]$EmailSubj=$Results, [string]$EmailBody=$Results)
$EmailMessage.Subject = $EmailSubj
$EmailMessage.Body = $EmailBody
$SMTPClient.Send( $EmailMessage )
}
$isHubTransportServer=(Test-Path "HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15\HubTransportRole")
if ($isHubTransportServer) {
$MessagesQueued=get-wmiobject -query "select MessagesQueuedForDelivery from Win32_PerfFormattedData_MSExchangeTransportQueues_MSExchangeTransportQueues"
$Messages=$MessagesQueued.MessagesQueuedForDelivery
$MRes=[string]$messages
if ($Messages) {
if ($Messages -lt $WarningLevel) {
$Results = 'Все в порядке. Количество сообщений в очереди на сервере '+$computername+': ' +$MRes.remove(2)
}
if ($Messages -gt $WarningLevel) {
$ResultError=1
$Results = 'Я извиняюсь, но количество сообщений в очереди на сервере '+$computername+': ' +$MRes.remove(2)+ ' и мне это не по нраву...'
}
if ($Messages -gt $CriticalLevel) {
$ResultError=2
$Results = 'Алярм!!! Что-то пошло не так, и количество сообщений в очереди на сервере '+$computername+' достигло: ' +$MRes.remove(2)+ '. Это меня тревожит...'
}
}
Else {
$ResultError=1
$Results = 'Внимание! Очередь сообщений НЕДОСТУПНА на сервере ' +$computername
}
}

Else {
$Results='Exchange 2013 не установлен'
}
if ($email) {
$SMTPClient = New-Object Net.Mail.SMTPClient($Server, $Port)
if (($Username) -and ($Password)) { $SMTPClient.Credentials = New-Object System.Net.NetworkCredential($Username, $Password) }
if ($SSL) { $SMTPClient.EnableSSL = $true }
$EmailMessage = New-Object System.Net.Mail.MailMessage
$EmailMessage.From = $From
$EmailMessage.To.Add( $To )
}

Switch ($ResultError) {
default {
write-host $Results
exit 0
}

1 {
write-host $Results
if ($email) { Send-EmailMessage }
exit 1
}

2 {
write-host $Results
if ($email) { Send-EmailMessage }
exit 2
}
}
#5
Скрипт для чанги 2013. Чекает у кого из юзеров объем почтового ящика близок к превышению квоты, отображает список и уведомляет о таковых по почте, если они имеются.

[noae][noae]$array = @()
$array2 = @()
$mailboxes = get-mailbox
$file = New-Item -itemtype file "C:\SCRIPTS\quotas.html" -Force
$mailalert=$false
Add-Content $file '<html><head>
<meta http-equiv="Content-Type" content="text/html;charset=windows-1251">
<title>System Status Report</title>
<style type="text/css">
<!--
BODY{background-color:#FFFFFF;}
TABLE{border-width: 1px;border-style: solid;border-color: black;}
TH{border-width: 1px;padding: 1px;border-style: solid;border-color: black;background-color:#1D92DC}
TD {border-width: 1px;padding: 2px;border-style: solid;border-color: black;background-color:#94BFE4}
TR {color:#000000;font-family:Tahoma;font-size:10pt;}
}
-->
</style>


<table>
<tr><th>mailbox: </th><th>state: </th></tr>
'
foreach ($line in $mailboxes) {
    $user = $line.alias
    $size2 = get-mailboxstatistics $user -erroraction silentlycontinue
    if ($size2 -ne $null) {
        $size = $size2.TotalItemSize.Value.ToMB()
    }
    $array += @(,($user,$size))
}
foreach ($line in $array) {
    $user = $line[0]
    $size = $line[1]
    If ($user -notmatch 'DiscoverySearch') {
        $quota2 = get-mailbox $user
        $quotapsr = $quota2.ProhibitSendReceiveQuota
        if ($quotapsr -ne "unlimited") {
            $quotapsr = $quota2.ProhibitSendReceiveQuota.Value.ToMB()
            if ($size -gt $quotapsr) {
                $quotacheckpsr = "Over"
            } else {
                $quotacheckpsr = "Under"
            }
        } else {
            $quotacheckpsr = "NoChecking"
        }
        $quotaiw = $quota2.IssueWarningQuota
        if ($quotaiw -ne "unlimited") {
            $quotaiw = $quota2.IssueWarningQuota.Value.ToMB()
            if ($size -gt $quotaiw) {
                $quotacheckiw = "Over"
            } else {
                $quotacheckiw = "Under"
            }
        } else {
            $quotacheckiw = "NoChecking"
        }
        $quotaps = $quota2.ProhibitSendQuota
        if ($quotaps -ne "unlimited") {
            $quotaps = $quota2.ProhibitSendQuota.Value.ToMB()
            if ($size -gt $quotaps) {
                $quotacheckps = "Over"
            } else {
                $quotacheckps = "Under"
            }
        } else {
            $quotacheckps = "NoChecking"
        }
        $array2 += @(,($user,$size,$quotacheckiw,$quotaiw,$quotacheckps,$quotaps,$quotacheckpsr,$quotapsr))
    }
}
foreach ($line in $array2) {
    if ($line[2] -eq "Over") {
        $mbname=$line[0]
        write-host "The mailbox for"$line[0]"is " -nonewline
        write-host "OVER the Issue Warning Quota, " -ForegroundColor red -nonewline
        Add-Content $file "<tr><td>$mbname</td><td style='background-color:red; color:Yellow;'><strong>OVER the Issue Warning Quota</strong></td></tr>"
        $mailalert=$true
    } else {
        write-host "The mailbox for"$line[0]"is " -nonewline
        write-host "UNDER the Issue Warning Quota, " -ForegroundColor green -nonewline
    }
    if ($line[4] -eq "Over") {
        $mbname=$line[0]
        write-host "OVER the Prohibit Send Quota," -ForegroundColor red -nonewline
        Add-Content $file "<tr><td>$mbname</td><td style='background-color:red; color:Yellow;'><strong>OVER the Prohibit Send Quota</strong></td></tr>"
        $mailalert=$true
    } else {
        write-host "UNDER the Prohibit Send Quota," -ForegroundColor green -nonewline
    }
    if ($line[6] -eq "Over") {
        $mbname=$line[0]
        write-host " and " -nonewline
        write-host "OVER the Prohibit Send Receive Quota." -ForegroundColor red
        Add-Content $file "<tr><td>$mbname</td><td style='background-color:red; color:Yellow;'><strong>OVER the Prohibit Send Receive Quota</strong></td></tr>"
        $mailalert=$true
    } else {
        write-host " and " -nonewline
        write-host "UNDER the Prohibit Send Receive Quota." -ForegroundColor green
    }
}
if ($mailalert -eq $true) {
$html = Get-Content "C:\SCRIPTS\quotas.html" -raw
Send-MailMessage -smtpServer mail.domain.net -from 'alert@domain.net' -to 'admin@domain.net' -subject "Quotas" -body $html -Encoding UTF8 -BodyAsHTML
}
[/noae][/noae]
#6
Простой скрипт для резервного копирования серверов в сетевую шару. Можно легко приспособить под свои нужды. Удаление устаревших резервных копий, и уведомление по почте, в случае, если что-то пошло не так.

$CurrentDate = get-date -format dd.MM.yyyy
$DC_Name = "NAME_"
$NPath = "\\storage\BACKUP\"
$Path_Net_Drive = $NPath + $DC_Name + $CurrentDate
$StoreBackup_Period = 5
$limit = (Get-Date).AddDays(-$StoreBackup_Period)
$from = "admin@domain.net"
$to = "admin@domain.net"
$smtp = "mail.domain.local"
$sub = "NAME LAST BACKUP RESULT"

Function CheckPath ($Path) {
$Path_Exists = Test-Path -Path $Path
If ($Path_Exists -eq $False) {New-Item $Path -type directory}
}
Add-PSSnapin Windows.Serverbackup -ErrorAction SilentlyContinue
$policy = New-WBPolicy
$target = New-WBBackupTarget -NetworkPath $Path_Net_Drive
Add-WBBareMetalRecovery -Policy $policy
Add-WBSystemState -policy $policy
Add-WBVolume -Policy $policy -Volume (Get-WBVolume -CriticalVolumes)
Set-WBVssBackupOptions -policy $policy -VssFullBackup
Add-WBBackupTarget -Policy $policy -Target $target
CheckPath $Path_Net_Drive | Out-Null
Start-WBBackup -Policy $policy

if ((Get-WBSummary).LastBackupResultHR -eq 0) {
Get-ChildItem -Path $NPath -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt $limit } | Remove-Item -Force
Get-ChildItem -Path $NPath -Recurse -Force | Where-Object { $_.PSIsContainer -and (Get-ChildItem -Path $_.FullName -Recurse -Force | Where-Object { !$_.PSIsContainer }) -eq $null } | Remove-Item -Force -Recurse
}
else {
Get-WBSummary > C:\SCRIPTS\summary.txt
Send-MailMessage -To $to -From $from -Subject $sub  -Attachments C:\SCRIPTS\summary.txt  -SmtpServer $smtp -DeliveryNotificationOption Never
}
#7
Unix / MIXED_ES Too many es are not es [Scrollout F1]
18 февраля 2019, 13:52:30
Добавил. Правило отрубилось, в тестах его больше нет.

До:

Score   Matching Rule   Description
-0.33   AWL   Adjusted score from AWL reputation of From: address
-1.90   BAYES_00   Bayes spam probability is 0 to 1%
0.98   FROM_EXCESS_BASE64   From: base64 encoded unnecessarily
1.00   KAM_LAZY_DOMAIN_SECURITY   Sending domain does not have any anti-forgery methods
0.50   KAM_NUMSUBJECT   Subject ends in numbers excluding current years
0.00   LOTS_OF_MONEY   Huge... sums of money
3.28   MIXED_ES   Too many es are not es
1.51   SUBJ_ALL_CAPS   Subject is all capitals

После:

Score   Matching Rule   Description
-0.49   AWL   Adjusted score from AWL reputation of From: address
-1.90   BAYES_00   Bayes spam probability is 0 to 1%
0.98   FROM_EXCESS_BASE64   From: base64 encoded unnecessarily
0.00   HTML_MESSAGE   HTML included in message
0.50   KAM_NUMSUBJECT   Subject ends in numbers excluding current years
0.00   LOTS_OF_MONEY   Huge... sums of money
1.51   SUBJ_ALL_CAPS   Subject is all capitals
#8
Unix / MIXED_ES Too many es are not es [Scrollout F1]
18 февраля 2019, 13:28:34
Столкнулся с этой же проблемой на eFa.
В зарубежных интернетах нашел это:

To disable the test you can add somewhere at the top, in

/etc/mail/spamassassin/local.cf

meta __E_LIKE_LETTER  (0)
meta __LOWER_E  (0)
SMF spam blocked by CleanTalk