الانتقال إلى المحتوى الرئيسي
اتبع هذا الدليل لتثبيت SentinelOne وCove وDNSFilter وغيرها. يمكن استخدام الحقول المخصصة للعميل في النصوص البرمجية لتثبيت البرامج بمعلومات خاصة بالعميل (مفاتيح ورموز وما إلى ذلك). يقوم هذا المثال بتثبيت:
  • Cove
  • SentinelOne
  • BitDefender
  • Webroot
1

أنشئ الحقل المخصص للعميل.

  1. انتقل إلى Settings > CRM > Custom Fields.
  2. أضِف حقلًا مخصصًا بالتفاصيل التالية:
    • Name: Cove Customer UID
    • Variable: CoverCustomerUID
2

املأ Cover Customer UID لكل عميل.

  1. انتقل إلى عميل محدد.
  2. انقر فوق Custom Fields.
  3. عدّل Cove Customer UID.
  4. أدخل Customer UID الذي تم استرجاعه من Cove.
3

اكتب النص البرمجي.

  1. انتقل إلى Scripts.
  2. أنشئ نصًا برمجيًا بالتفاصيل التالية:
    • Name: Install-Cove
    • Content:
# ===== Configuration Variables =====
$CUSTOMERUID = $gorelo:client.CoveCustomerUID
$PROFILEID = "All-in" # Default retention policy
$PRODUCT = "0" # Profile ID (use "0" for no profile or a specific profile ID)
$DOWNLOADPATH = "C:\Windows\Temp"
# ===================================

$startTime = Get-Date
$INSTALL = "$DOWNLOADPATH\bm#$CUSTOMERUID#$PROFILEID#.exe"

# Download installer
try {
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    (New-Object System.Net.WebClient).DownloadFile("https://cdn.cloudbackup.management/maxdownloads/mxb-windows-x86_x64.exe", "$INSTALL")
} catch {
    Write-Output "ERROR: Failed to download installer - $_"
    exit 1
}

# Run installer
try {
    Start-Process -FilePath $INSTALL -ArgumentList "-product-name `"$PRODUCT`"" -Wait -NoNewWindow
    Start-Sleep -Seconds 5
} catch {
    Write-Output "ERROR: Installation failed - $_"
    exit 1
}

# Verify installation
$service = Get-Service -Name "Backup Service Controller" -ErrorAction SilentlyContinue
$process = Get-Process -Name "BackupFP" -ErrorAction SilentlyContinue

if ($service.Status -eq 'Running' -and $process) {
    Write-Output "SUCCESS: Backup Service Controller is running and BackupFP process is active."
    Write-Output "Installed for Customer UID: $CUSTOMERUID"
    $exitCode = 0
} else {
    Write-Output "WARNING: Backup Service Controller or BackupFP process is not running as expected."
    Write-Output "Customer UID: $CUSTOMERUID"
    
    # Check log for errors
    $logDirectory = "C:\ProgramData\mxb\Backup Manager\logs\ClientTool"
    if (Test-Path $logDirectory) {
        $latestLog = Get-ChildItem -Path $logDirectory -Filter "*.log" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
        if ($latestLog) {
            $errorLines = Get-Content -Path $latestLog.FullName | Where-Object { $_ -match '\[E\]' } | Select-Object -Last 3
            if ($errorLines) {
                Write-Output "Recent errors from log:"
                $errorLines | ForEach-Object { Write-Output $_ }
            }
        }
    }
    $exitCode = 1
}

$endTime = Get-Date
Write-Output "Installation completed in $([math]::Round(($endTime - $startTime).TotalSeconds, 2)) seconds."
exit $exitCode