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:
- Replace
YOUR_LICENSE_KEY_HEREwith actual license - Replace
YOUR_PASSWORD_HEREwith secure password - Store these values securely (not in documentation)
Deployment Order
- Deploy AnyDesk app (Win32 or Enterprise Catalog)
- Wait for installation to complete
- 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:
- Open AnyDesk
- Menu → Settings → License → Enter key
- Security → Set unattended access password
#bcm/intune/script/anydesk