Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $secpasswd = ConvertTo-SecureString $env:SP_PASSWORD -AsPlainText -Force;
- $mycreds = New-Object System.Management.Automation.PSCredential ($env:SP_USERNAME, $secpasswd)
- Add-AzureRmAccount -ServicePrincipal -Tenant $env:TENANTID -Credential $mycreds;
- $context = Get-AzureRmContext;
- Set-AzureRmContext -Context $context;
- # Start VM
- Start-AzureRmVM -ResourceGroupName myResourceGroup -Name myDevice | Out-String
- $password = ConvertTo-SecureString "myPassword" -AsPlainText -Force
- $cred= New-Object System.Management.Automation.PSCredential ("myUsername", $password )
- #Enter-PSSession -ConnectionUri https://<public_ip> -Credential $cred -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck) -Authentication Negotiate
- $Server="<public_ip>"
- $User="myUsername"
- $Password="myPassword"
- cmdkey /generic:TERMSRV/$Server /user:$User /pass:$Password
- mstsc /v:$Server
Add Comment
Please, Sign In to add comment