Files
RDP-login-monitor/Encrypt-DpapiForRdpMonitor.ps1
PTah 038363c5c7 fix: UTF-8 BOM for PS 5.1 script parsing (2.1.15-SAC)
Avoid mojibake/parser errors when running Deploy and helpers without BOM on Windows PowerShell 5.1.
2026-07-14 20:04:42 +10:00

13 lines
684 B
PowerShell

# Запуск: от администратора на ТОМ ЖЕ компьютере, где будет Login_Monitor.ps1.
# Результат (Base64) вставьте в login_monitor.settings.ps1 или exchange_monitor.settings.ps1:
# $TelegramBotTokenProtectedB64 / $TelegramChatIDProtectedB64 / $MailSmtpPasswordProtectedB64.
param(
[Parameter(Mandatory = $true)][string]$PlainText
)
Add-Type -AssemblyName System.Security
$bytes = [Text.Encoding]::UTF8.GetBytes($PlainText)
$protected = [System.Security.Cryptography.ProtectedData]::Protect(
$bytes, $null, [System.Security.Cryptography.DataProtectionScope]::LocalMachine
)
[Convert]::ToBase64String($protected)