Skip to content

Instantly share code, notes, and snippets.

@irwinwilliams
Created September 23, 2017 07:44
Show Gist options
  • Save irwinwilliams/43e4038388576946489cdaad2501637d to your computer and use it in GitHub Desktop.
Save irwinwilliams/43e4038388576946489cdaad2501637d to your computer and use it in GitHub Desktop.
Change RDP settings on Azure Web Role
#This works with a Classic Azure Cloud Service Web Role
$SubsciptionName = "<name>"
$CloudServiceName = "<web-role-name>"
Add-AzureAccount
Select-AzureSubscription -Name $SubscriptionName
Get-AzureRole -ServiceName $CloudServiceName
$username = "<username>"
$password = "<other-options-can-be-used>"
$securepassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$expiry = $(Get-Date).AddDays(1)
$rdpcredential = New-Object System.Management.Automation.PSCredential $username,$securepassword
Set-AzureServiceRemoteDesktopExtension -ServiceName $CloudServiceName -Credential $rdpcredential -Expiration $expiry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment