Déployer l'application de bureau Workspace avec Devolutions Server et Devolutions Hub Business préconfigurés

Ce guide explique les étapes pour déployer l'application Workspace avec des sources de données préconfigurées Devolutions Server et Devolutions Hub Business. L'installation est gérée par un RMM, suivie d'un script PowerShell pour générer le fichier de configuration nécessaire.

Pour être ajoutés, votre Devolutions Server et Devolutions Hub Business doivent être accessibles depuis l'ordinateur utilisé pour la préconfiguration.

Déployer l'application Workspace

  1. Installer l'application Workspace en utilisant un RMM.

  2. Exécuter le script PowerShell suivant après avoir remplacé les variables par vos données.

    Pour trouver l'organizationId pour le script PowerShell, naviguer vers https:///api/server-configurations (uniquement nécessaire pour Devolutions Hub Business).

    Avec Devolutions Hub Business :

    #Requires -RunAsAdministrator
    
    $HUB_NAME = "<hub-name>"
    $ORGANIZATION_ID = "<org-id>"
    
    $ErrorActionPreference = 'Stop'
    
    try {
        $appDataPath = [System.Environment]::GetFolderPath('ApplicationData')
        $configDir = Join-Path $appDataPath 'net.devolutions\Workspace'
        $configFilePath = Join-Path $configDir 'Config.cfg'
        $logPath = Join-Path $configDir 'CreateConfigLog.txt'
    
        if (-not (Test-Path $configDir)) {
            New-Item -Path $configDir -ItemType Directory -Force | Out-Null
        }
    
        $timestamp = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'
        "[$timestamp] Starting Hub configuration creation..." | Out-File -FilePath $logPath -Encoding UTF8
    
        $configContent = @{
            preventStartup = $true
            hubs = @(@{
                url = "https://$HUB_NAME.devolutions.app"
                organizationId = if ($ORGANIZATION_ID) { $ORGANIZATION_ID } else { "" }
            })
            dvls = @()
        }
    
        $json = $configContent | ConvertTo-Json -Compress -Depth 3
        "[$timestamp] Hub configuration created: $json" | Out-File -FilePath $logPath -Append -Encoding UTF8
    
        $json | Out-File -FilePath $configFilePath -Encoding UTF8
    
        "[$timestamp] Configuration file created successfully at $configFilePath" | Out-File -FilePath $logPath -Append -Encoding UTF8
        Write-Host "Hub configuration created successfully!" -ForegroundColor Green
        Write-Host "Hub: $HUB_NAME.devolutions.app" -ForegroundColor Cyan
    
    } catch {
        $timestamp = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'
        "[$timestamp] Error creating config file: $($_.Exception.Message)" | Out-File -FilePath $logPath -Append -Encoding UTF8
        Write-Error $_.Exception.Message
        exit 1
    }
    

    Avec Devolutions Server :

    #Requires -RunAsAdministrator
    
    $DVLS_SERVER_URL = "<DVLS-server-url>"
    
    $ErrorActionPreference = 'Stop'
    
    try {
        $appDataPath = [System.Environment]::GetFolderPath('ApplicationData')
        $configDir = Join-Path $appDataPath 'net.devolutions\Workspace'
        $configFilePath = Join-Path $configDir 'Config.cfg'
        $logPath = Join-Path $configDir 'CreateConfigLog.txt'
    
        if (-not (Test-Path $configDir)) {
            New-Item -Path $configDir -ItemType Directory -Force | Out-Null
        }
    
        $timestamp = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'
        "[$timestamp] Starting DVLS configuration creation..." | Out-File -FilePath $logPath -Encoding UTF8
    
        $configContent = @{
            preventStartup = $true
            hubs = @()
            dvls = @(@{
                name = 'Devolutions Server'
                serverUrl = $DVLS_SERVER_URL
                serverVersion = ''
            })
        }
    
        $json = $configContent | ConvertTo-Json -Compress -Depth 3
        "[$timestamp] DVLS configuration created: $json" | Out-File -FilePath $logPath -Append -Encoding UTF8
    
        $json | Out-File -FilePath $configFilePath -Encoding UTF8
    
        "[$timestamp] Configuration file created successfully at $configFilePath" | Out-File -FilePath $logPath -Append -Encoding UTF8
        Write-Host "DVLS configuration created successfully!" -ForegroundColor Green
        Write-Host "Server URL: $DVLS_SERVER_URL" -ForegroundColor Cyan
    
    } catch {
        $timestamp = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'
        "[$timestamp] Error creating config file: $($_.Exception.Message)" | Out-File -FilePath $logPath -Append -Encoding UTF8
        Write-Error $_.Exception.Message
        exit 1
    }
    

    Pour Devolutions Hub Business et Devolutions Server :

    #Requires -RunAsAdministrator
    
    $ENABLE_HUB = $true
    $HUB_NAME = "<hub-name>"
    $ORGANIZATION_ID = "<org-id>"
    
    $ENABLE_DVLS = $true
    $DVLS_SERVER_URL = "<DVLS-server-url>"
    
    $ErrorActionPreference = 'Stop'
    
    try {
        if (-not $ENABLE_HUB -and -not $ENABLE_DVLS) {
            throw "At least one configuration (Hub or DVLS) must be enabled"
        }
    
        $appDataPath = [System.Environment]::GetFolderPath('ApplicationData')
        $configDir = Join-Path $appDataPath 'net.devolutions\Workspace'
        $configFilePath = Join-Path $configDir 'Config.cfg'
        $logPath = Join-Path $configDir 'CreateConfigLog.txt'
    
        if (-not (Test-Path $configDir)) {
            New-Item -Path $configDir -ItemType Directory -Force | Out-Null
        }
    
        $timestamp = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'
        "[$timestamp] Starting configuration creation..." | Out-File -FilePath $logPath -Encoding UTF8
    
        $configContent = @{
            preventStartup = $true
        }
    
        if ($ENABLE_HUB) {
            $configContent.hubs = @(@{
                url = "https://$HUB_NAME.devolutions.app"
                organizationId = if ($ORGANIZATION_ID) { $ORGANIZATION_ID } else { "" }
            })
            "[$timestamp] Hub configuration enabled: $HUB_NAME.devolutions.app" | Out-File -FilePath $logPath -Append -Encoding UTF8
            Write-Host "✓ Hub configuration enabled" -ForegroundColor Green
            Write-Host "  Hub: $HUB_NAME.devolutions.app" -ForegroundColor Cyan
        } else {
            $configContent.hubs = @()
            Write-Host "✗ Hub configuration disabled" -ForegroundColor Yellow
        }
    
        if ($ENABLE_DVLS) {
            $configContent.dvls = @(@{
                name = 'Devolutions Server'
                serverUrl = $DVLS_SERVER_URL
                serverVersion = ''
            })
            "[$timestamp] DVLS configuration enabled: $DVLS_SERVER_URL" | Out-File -FilePath $logPath -Append -Encoding UTF8
            Write-Host "✓ DVLS configuration enabled" -ForegroundColor Green
            Write-Host "  Server URL: $DVLS_SERVER_URL" -ForegroundColor Cyan
        } else {
            $configContent.dvls = @()
            Write-Host "✗ DVLS configuration disabled" -ForegroundColor Yellow
        }
    
        $json = $configContent | ConvertTo-Json -Compress -Depth 3
        "[$timestamp] Configuration created: $json" | Out-File -FilePath $logPath -Append -Encoding UTF8
    
        $json | Out-File -FilePath $configFilePath -Encoding UTF8
    
        "[$timestamp] Configuration file created successfully at $configFilePath" | Out-File -FilePath $logPath -Append -Encoding UTF8
        Write-Host "`nConfiguration created successfully!" -ForegroundColor Green
        Write-Host "File: $configFilePath" -ForegroundColor Cyan
    
    } catch {
        $timestamp = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'
        "[$timestamp] Error creating config file: $($_.Exception.Message)" | Out-File -FilePath $logPath -Append -Encoding UTF8
        Write-Error $_.Exception.Message
        exit 1
    }
    
  3. Le script générera un fichier de configuration dans le dossier AppData de l'utilisateur. Par exemple :

    C:\Users\USERNAME\AppData\Roaming\net.devolutions\Workspace\Config.cfg

  4. Lancer l'application de bureau Workspace.

  5. Les espaces Devolutions Server et Devolutions Hub Business sont créés.

  6. Ouvrir les espaces et s'y connecter.

Ajouter une source de données comme argument MSI

Lors du déploiement de l'application de bureau Workspace à l'aide de l'installateur MSI, ajouter un Devolutions Server ou une source de données Devolutions Hub Business en l'intégrant comme argument au cours de l'installation.

  • Devolutions Server : msiexec /i "installer.msi" DVLS_SERVER_URL=https://dvlsurl.com

  • Devolutions Hub Business : msiexec /i "installer.msi" HUB_NAME=workspace ORGANIZATION_ID=devolutions

Devolutions Forum logo Donnez-nous vos commentaires