From cdf563cbe9e6c5dd5ea837946a67f536623b25a0 Mon Sep 17 00:00:00 2001 From: PTah Date: Fri, 22 May 2026 15:00:30 +1000 Subject: [PATCH] fix(deploy): copy exchange_monitor.settings.example to ProgramData (v1.6.4) Example settings were published to NETLOGON but omitted from Deploy-DomainMonitors file list, so Copy-Item from ProgramData failed on fresh installs. --- Deploy-DomainMonitors.ps1 | 3 ++- Docs/exchange-mail-security.md | 11 ++++++++--- Exchange-MailSecurity.ps1 | 2 +- version.txt | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Deploy-DomainMonitors.ps1 b/Deploy-DomainMonitors.ps1 index 7cb054b..e8a1327 100644 --- a/Deploy-DomainMonitors.ps1 +++ b/Deploy-DomainMonitors.ps1 @@ -28,7 +28,8 @@ $PsExe = "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" $ExchangeFiles = @( 'Exchange-MailSecurity.ps1', 'Notify-Common.ps1', - 'Install-DomainMonitors.ps1' + 'Install-DomainMonitors.ps1', + 'exchange_monitor.settings.example.ps1' ) function Write-DeployLog { diff --git a/Docs/exchange-mail-security.md b/Docs/exchange-mail-security.md index fc13144..37c5ef2 100644 --- a/Docs/exchange-mail-security.md +++ b/Docs/exchange-mail-security.md @@ -114,9 +114,14 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass -File "\\B26\NETLOGON\RDP-logi ### 3. Локальные настройки (один раз) ```powershell -Copy-Item "C:\ProgramData\RDP-login-monitor\exchange_monitor.settings.example.ps1" ` - "C:\ProgramData\RDP-login-monitor\exchange_monitor.settings.ps1" -notepad C:\ProgramData\RDP-login-monitor\exchange_monitor.settings.ps1 +# После Deploy v1.6.4+ образец лежит в ProgramData; иначе — с NETLOGON: +$ex = 'C:\ProgramData\RDP-login-monitor' +$src = Join-Path $ex 'exchange_monitor.settings.example.ps1' +if (-not (Test-Path -LiteralPath $src)) { + $src = '\\B26\NETLOGON\RDP-login-monitor\exchange_monitor.settings.example.ps1' +} +Copy-Item -LiteralPath $src -Destination (Join-Path $ex 'exchange_monitor.settings.ps1') +notepad (Join-Path $ex 'exchange_monitor.settings.ps1') ``` Задайте: diff --git a/Exchange-MailSecurity.ps1 b/Exchange-MailSecurity.ps1 index 9b0bfff..0caa322 100644 --- a/Exchange-MailSecurity.ps1 +++ b/Exchange-MailSecurity.ps1 @@ -25,7 +25,7 @@ $ErrorActionPreference = 'Stop' # КОНФИГУРАЦИЯ # ============================================ -$ScriptVersion = '1.6.3' +$ScriptVersion = '1.6.4' $script:InstallRoot = [System.IO.Path]::GetFullPath("$env:ProgramData\RDP-login-monitor") $script:CanonicalScriptName = 'Exchange-MailSecurity.ps1' $LogFile = Join-Path $script:InstallRoot 'Logs\exchange_mail_security.log' diff --git a/version.txt b/version.txt index 266146b..9edc58b 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.6.3 +1.6.4