> ## Documentation Index
> Fetch the complete documentation index at: https://help.gorelo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# تثبيت البرامج عبر الحقول المخصصة للعميل

> ثبّت برامج مثل Cove وSentinelOne وBitDefender وWebroot باستخدام نصوص Gorelo البرمجية التي تستخدم حقولًا مخصصة خاصة بالعميل للمفاتيح والرموز ومعرّفات المستأجر.

اتبع هذا الدليل لتثبيت SentinelOne وCove وDNSFilter وغيرها.

يمكن استخدام الحقول المخصصة للعميل في النصوص البرمجية لتثبيت البرامج بمعلومات خاصة بالعميل (مفاتيح ورموز وما إلى ذلك).

يقوم هذا المثال بتثبيت:

* Cove
* SentinelOne
* BitDefender
* Webroot

<Tabs>
  <Tab title="Cove">
    <Steps>
      <Step title="أنشئ الحقل المخصص للعميل.">
        1. انتقل إلى **Settings** > **CRM** > **[<u>Custom Fields</u>](https://app.gorelo.io/Admin/admin-settings#crm#clientcustomfields)<u>.</u>**
        2. أضِف حقلًا مخصصًا بالتفاصيل التالية:
           * **Name**: Cove Customer UID
           * **Variable**: CoverCustomerUID
      </Step>

      <Step title="املأ Cover Customer UID لكل عميل.">
        1. انتقل إلى عميل محدد.
        2. انقر فوق **Custom Fields.**
        3. عدّل **Cove Customer UID.**
        4. أدخل Customer UID الذي تم استرجاعه من Cove.
      </Step>

      <Step title="اكتب النص البرمجي.">
        1. انتقل إلى **[<u>Scripts</u>](https://app.gorelo.io/Asset/script-list)<u>.</u>**
        2. أنشئ نصًا برمجيًا بالتفاصيل التالية:
           * **Name**: Install-Cove
           * **Content**:

        ```powershell theme={null}
        # ===== 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
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="SentinelOne">
    <Steps>
      <Step title="أنشئ الحقل المخصص للعميل.">
        1. انتقل إلى **Settings** > **CRM** > **[<u>Custom Fields</u>](https://app.gorelo.io/Admin/admin-settings#crm#clientcustomfields)<u>:</u>**
        2. أضِف حقلًا مخصصًا بالتفاصيل التالية:
           * **Name**: SentinelOne Site Token
           * **Variable**: s1token

        <Frame>
          <img src="https://mintcdn.com/gorelo/-gDoUuq9lm8_69OG/images/image-87.png?fit=max&auto=format&n=-gDoUuq9lm8_69OG&q=85&s=031f83e7ab18bcf33261433dacae33df" alt="Image" width="782" height="624" data-path="images/image-87.png" />
        </Frame>
      </Step>

      <Step title="املأ رمز البرنامج لكل عميل.">
        1. انتقل إلى عميل محدد
        2. انقر فوق **Custom Fields.**
                   <Frame>
                     <img src="https://mintcdn.com/gorelo/-gDoUuq9lm8_69OG/images/image-88.png?fit=max&auto=format&n=-gDoUuq9lm8_69OG&q=85&s=b7c8ddd252eb239aaf67ef9f00553e47" alt="Image" width="699" height="914" data-path="images/image-88.png" />
                   </Frame>
        3. عدّل **SentinelOne Site Token**.
        4. أدخل Site Token الذي تم استرجاعه من SentinelOne.
                   <Frame>
                     <img src="https://mintcdn.com/gorelo/-gDoUuq9lm8_69OG/images/image-89.png?fit=max&auto=format&n=-gDoUuq9lm8_69OG&q=85&s=937c28444f16ea4989b6fc99af96f7ee" alt="Image" width="678" height="386" data-path="images/image-89.png" />
                   </Frame>
           يمكنك استرجاع SentinelOne Site Token الخاص بك من https\://\<DomainName>.[**sentinelone.net/dashboard**](http://sentinelone.net/dashboard). انتقل إلى موقع، ثم إلى علامة التبويب **Site Info**.
                   <Frame>
                     <img src="https://mintcdn.com/gorelo/-gDoUuq9lm8_69OG/images/image-90.png?fit=max&auto=format&n=-gDoUuq9lm8_69OG&q=85&s=baef851dc57746d91b1bc79658c23bb4" alt="Image" width="1641" height="617" data-path="images/image-90.png" />
                   </Frame>
      </Step>

      <Step title="أنشئ ملف المثبّت.">
        1. انتقل إلى **Settings** > Asset > **[<u>Files</u>](https://app.gorelo.io/Admin/admin-settings#asset#filerepository)<u>.</u>**
        2. أضِف ملفًا بالتفاصيل التالية:
           * **File**: قم بتحميل أحدث مثبّت MSI
           * **Variable**: S1Installer
      </Step>

      <Step title="اكتب النص البرمجي.">
        1. انتقل إلى **[<u>Scripts</u>](https://app.gorelo.io/Asset/script-list)<u>.</u>**
        2. أنشئ نصًا برمجيًا بالتفاصيل التالية:
           * **Name**: Install-SentineOne.
           * **Content**:

        ```powershell theme={null}
        #Silently install SentinelOne

        if($gorelo:client.s1token){

          $S1Service = get-service -Name 'Sentinel Agent' -ErrorAction SilentlyContinue

          if($S1Service -eq $null){

                msiexec /i $gorelo:file.S1Installer SITE_TOKEN=$gorelo:client.s1token /quiet /norestart
               
          }
        }
        ```
      </Step>

      <Step title="انشر النص البرمجي عبر سياسة.">
        1. انتقل إلى **[<u>Policies</u>](https://app.gorelo.io/Asset/policy-management)<u>.</u>**
        2. عدّل سياسة موجودة تغطي الأصول التي تريد تثبيت SentinelOne عليها.
        3. أضِف النص البرمجي **Install-SentineOne** واضبطه ليتكرر يوميًا في الوقت المفضل لديك.
        4. **وزّع** السياسة.
      </Step>
    </Steps>
  </Tab>

  <Tab title="BitDefender">
    <Steps>
      <Step title="أنشئ الحقل المخصص للعميل.">
        1. انتقل إلى **Settings** > **CRM** > **[<u>Custom Fields</u>](https://app.gorelo.io/Admin/admin-settings#crm#clientcustomfields)<u>.</u>**
        2. أضِف حقلًا مخصصًا بالتفاصيل التالية:
           * **Name**: Bitdefender URL
           * **Variable**: bitdefenderURL

        <Frame>
          <img src="https://mintcdn.com/gorelo/T3NJMN-hVMIJ4iQN/images/image-105.png?fit=max&auto=format&n=T3NJMN-hVMIJ4iQN&q=85&s=c3008e52a40d2950813499b65dc391f2" alt="Image" width="803" height="644" data-path="images/image-105.png" />
        </Frame>
      </Step>

      <Step title="املأ BitDefender URL لكل عميل.">
        1. انتقل إلى عميل محدد.
        2. انقر فوق **Custom Fields.**
                   <Frame>
                     <img src="https://mintcdn.com/gorelo/T3NJMN-hVMIJ4iQN/images/image-106.png?fit=max&auto=format&n=T3NJMN-hVMIJ4iQN&q=85&s=c1073ee7cec0fb54745993497c098996" alt="Image" width="699" height="914" data-path="images/image-106.png" />
                   </Frame>
        3. عدّل **Bitdefender URL**.
        4. أدخل عنوان URL لملف exe الخاص بالتثبيت الذي تم استرجاعه من Bitdefender لكل عميل.
                   <Frame>
                     <img src="https://mintcdn.com/gorelo/T3NJMN-hVMIJ4iQN/images/image-107.png?fit=max&auto=format&n=T3NJMN-hVMIJ4iQN&q=85&s=d8e2868ac6c7ec0192e2e2d1f1ce2064" alt="Image" width="704" height="414" data-path="images/image-107.png" />
                   </Frame>
                   <Tip>
                     يجب أن يبدو Bitdefender URL لملف exe الخاص بالتثبيت هكذا (مثال وهمي): `htttps://cloudgz.gravityzone.bitdefender.com/Packages/BSTWIN/0/setupdownloader_[aHR0cHM6Ly9jbG91ZGdLWDawWVjcy5ncR5em9uZS5iaXRkZWZl3ddwawGfawdmRlci5jb20vUGFja2FnZXMvQlNUV0lOLzAvdkluc3RhbGxlci54bw-bGFuZz1lbi1VUw==].exe`
                   </Tip>
      </Step>

      <Step title="اكتب النص البرمجي.">
        1. انتقل إلى **[<u>Scripts</u>](https://app.gorelo.io/Asset/script-list)<u>.</u>**
        2. أنشئ نصًا برمجيًا بالتفاصيل التالية:
           * **Name**: Install-Bitdefender
           * **Content**:

        ```powershell theme={null}
        #$gorelo:client.bitdefenderURL

        # Check if Bitdefender is already installed
        if (Get-Service -Name "EPProtectedService" -ErrorAction SilentlyContinue) {
            Write-Host "Bitdefender is already installed. Skipping installation."
            exit 0
        }

        # Proceed with installation
        $url = $gorelo:client.bitdefenderURL
        $filename = Split-Path $url -Leaf
        $installer = Join-Path $env:TEMP $filename

        Write-Host "Downloading Bitdefender installer..."
        (New-Object System.Net.WebClient).DownloadFile($url, $installer)

        Write-Host "Installing Bitdefender..."
        Start-Process -FilePath $installer -ArgumentList "/silent" -Wait
        Remove-Item -LiteralPath $installer

        # Verify installation
        Start-Sleep -Seconds 10  # Give the service time to start
        $service = Get-Service -Name "EPProtectedService" -ErrorAction SilentlyContinue

        if ($service -and $service.Status -eq "Running") {
            Write-Host "Installation successful! EPProtectedService is running."
            exit 0
        } else {
            Write-Host "Installation may have failed. EPProtectedService not found or not running."
            exit 1
        }
        ```
      </Step>

      <Step title="انشر النص البرمجي عبر سياسة.">
        1. انتقل إلى **[<u>Policies</u>](https://app.gorelo.io/Asset/policy-management)<u>.</u>**
        2. عدّل سياسة موجودة تغطي الأصول التي تريد تثبيت Bitdefender عليها.
        3. أضِف النص البرمجي **Install-Bitdefender** واضبطه ليتكرر يوميًا في الوقت المفضل لديك.
        4. **وزّع** السياسة.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Webroot">
    <Steps>
      <Step title="أنشئ الحقل المخصص للعميل.">
        1. انتقل إلى **Settings** > **CRM** > **[<u>Custom Fields</u>](https://app.gorelo.io/Admin/admin-settings#crm#clientcustomfields)<u>.</u>**
        2. أضِف حقلًا مخصصًا بالتفاصيل التالية:
           * **Name**: Webroot Key
           * **Variable**: webrootKey

        <Frame>
          <img src="https://mintcdn.com/gorelo/vclHs_96o-5AzbEe/images/image-102.png?fit=max&auto=format&n=vclHs_96o-5AzbEe&q=85&s=94afcc15964d77a73b1f06a85397187f" alt="Image" width="749" height="585" data-path="images/image-102.png" />
        </Frame>
      </Step>

      <Step title="املأ مفتاح Webroot لكل عميل.">
        1. انتقل إلى عميل محدد.
        2. انقر فوق **Custom Fields.**
                   <Frame>
                     <img src="https://mintcdn.com/gorelo/vclHs_96o-5AzbEe/images/image-103.png?fit=max&auto=format&n=vclHs_96o-5AzbEe&q=85&s=29d3f4f00950d7dabc7b019d6c81f7f0" alt="Image" width="699" height="914" data-path="images/image-103.png" />
                   </Frame>
        3. عدّل **Webroot Key**.
        4. أدخل Webroot Key **[الذي تم استرجاعه من Webroot](https://answers.webroot.com/Webroot/ukp.aspx?pid=17\&app=vw\&vw=1\&solutionid=984).**
                   <Frame>
                     <img src="https://mintcdn.com/gorelo/vclHs_96o-5AzbEe/images/image-104.png?fit=max&auto=format&n=vclHs_96o-5AzbEe&q=85&s=c340167502bfba8e2933ac0d7b68a23e" alt="Image" width="673" height="399" data-path="images/image-104.png" />
                   </Frame>
      </Step>

      <Step title="أنشئ ملف المثبّت.">
        1. انتقل إلى **Settings** > Asset > **[<u>Files</u>](https://app.gorelo.io/Admin/admin-settings#asset#filerepository)<u>.</u>**
        2. أضِف ملفًا بالتفاصيل التالية:
           * **File**: قم بتحميل أحدث مثبّت MSI
           * **Variable**: webrootInstaller
      </Step>

      <Step title="أنشئ النص البرمجي.">
        1. انتقل إلى **[<u>Scripts</u>](https://app.gorelo.io/Asset/script-list)<u>.</u>**
        2. أنشئ نصًا برمجيًا بالتفاصيل التالية:
           * **Name**: Install-Webroot
           * **Content**:

        ```powershell theme={null}
        # Silently install Webroot
        if($gorelo:client.webrootKey){
            $WebrootService = Get-Service -Name 'WRSVC' -ErrorAction SilentlyContinue
            if($WebrootService -eq $null){
                msiexec /i $gorelo:file.webrootInstaller GUILIC=$gorelo:client.webrootKey CMDLINE=SME,quiet /qn /l*v install.log
            }
        }
        ```
      </Step>

      <Step title="انشر النص البرمجي عبر سياسة">
        1. انتقل إلى **[<u>Policies</u>](https://app.gorelo.io/Asset/policy-management)<u>.</u>**
        2. عدّل سياسة موجودة تغطي الأصول التي تريد تثبيت Webroot عليها.
        3. أضِف النص البرمجي **Install-Webroot** واضبطه ليتكرر يوميًا في الوقت المفضل لديك.
        4. **وزّع** السياسة.

        بدلاً من ذلك، يمكنك إضافة النص البرمجي كخطوة معالجة لـ Service Check، على سبيل المثال:

        <Frame>
          <img src="https://mintcdn.com/gorelo/T3NJMN-hVMIJ4iQN/images/image-105.png?fit=max&auto=format&n=T3NJMN-hVMIJ4iQN&q=85&s=c3008e52a40d2950813499b65dc391f2" alt="Image" width="803" height="644" data-path="images/image-105.png" />
        </Frame>
      </Step>
    </Steps>
  </Tab>
</Tabs>
