Skip to content

Instantly share code, notes, and snippets.

@JeremyMorgan
Created August 17, 2016 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeremyMorgan/28271d520788efd92dedd2675b4c5fe6 to your computer and use it in GitHub Desktop.
Save JeremyMorgan/28271d520788efd92dedd2675b4c5fe6 to your computer and use it in GitHub Desktop.
Enable Remote Desktop in Azure
#ConvertTo-SecureString -String "yourpassword" -AsPlainText -Force | ConvertFrom-SecureString | Set-Content "password.txt"
$servicename = "yourcloudservice"
$username = "remotedesktopuser"
$securepassword = Get-Content -Path "password.txt" | ConvertTo-SecureString
$expiry = $(Get-Date).AddDays(1)
$credential = New-Object System.Management.Automation.PSCredential $username,$securepassword
Set-AzureServiceRemoteDesktopExtension -ServiceName $servicename -Credential $credential -Expiration $expiry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment