Skip to content

Instantly share code, notes, and snippets.

@ploegert
Created July 14, 2015 15:26
Show Gist options
  • Select an option

  • Save ploegert/0e80f2035147677a9370 to your computer and use it in GitHub Desktop.

Select an option

Save ploegert/0e80f2035147677a9370 to your computer and use it in GitHub Desktop.
ACQUIRING REMOTE ACCESS TO OUR VM Since we know the name of your VM we can simply use Azure SDK cmdlets to get RDP file and kick off a remote access to it. See Azure Powershell SDK documentation for more information. src: http://blogs.msdn.com/b/powershell/archive/2014/08/07/introducing-the-azure-powershell-dsc-desired-state-configuration-extens…
$vm = Get-AzureVM –ServiceName "example-1-svc" –Name "example-1"
$rdp = Get-AzureEndpoint -Name "RDP" -VM $vm
$hostdns = (New-Object "System.Uri" $vm.DNSName).Authority
$port = $rdp.Port
Start-Process "mstsc" -ArgumentList "/V:$hostdns`:$port /w:1024 /h:768
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment