Script: AnyDesk License


Purpose

Configures AnyDesk with license key and unattended access password after deployment.


Deployment Settings

Setting Value
Run as System (No)
64-bit PowerShell Yes
Signature check No
Assigned to All Devices

Script: Configure-AnyDesk.ps1

<#
.SYNOPSIS
    Configures AnyDesk license and password
.DESCRIPTION
    Sets license key and unattended access password
    Run AFTER AnyDesk is installed
.NOTES
    BCM - Deploy via Intune Platform Scripts
    Run as SYSTEM

    ⚠️ UPDATE THESE VALUES BEFORE DEPLOYING
#>

# ⚠️ CHANGE THESE VALUES
$LicenseKey = "YOUR_LICENSE_KEY_HERE"
$UnattendedPassword = "YOUR_PASSWORD_HERE"

$AnyDesk = "C:\Program Files (x86)\AnyDesk\AnyDesk.exe"

if (Test-Path $AnyDesk) {
    # Stop AnyDesk if running
    Stop-Process -Name "AnyDesk" -Force -ErrorAction SilentlyContinue
    Start-Sleep -Seconds 2

    # Register license
    Write-Host "Registering license..."
    echo $LicenseKey | & $AnyDesk --register-license

    # Set unattended password
    Write-Host "Setting unattended password..."
    echo $UnattendedPassword | & $AnyDesk --set-password

    # Restart AnyDesk
    Start-Process $AnyDesk

    Write-Host "AnyDesk configured successfully"
} else {
    Write-Error "AnyDesk not found at $AnyDesk"
    exit 1
}

Important Notes

⚠️ Before deploying:

  1. Replace YOUR_LICENSE_KEY_HERE with actual license
  2. Replace YOUR_PASSWORD_HERE with secure password
  3. Store these values securely (not in documentation)

Deployment Order

  1. Deploy AnyDesk app (Win32 or Enterprise Catalog)
  2. Wait for installation to complete
  3. Deploy this script

Script will fail if AnyDesk isn't installed yet.


Alternative: Manual Configuration

If script doesn't work, configure manually on each device:

  1. Open AnyDesk
  2. Menu → Settings → License → Enter key
  3. Security → Set unattended access password

#bcm/intune/script/anydesk