想知道是否有办法启用RDP后部署。发布云服务?
在打包之前可以使用选项来执行此操作!
答案 0 :(得分:0)
为此找到了一个有效的解决方案!
设置-AzureServiceRemoteDesktopExtension 强>
您需要将ServiceName传递给下面的代码段。
if(($UserName) -and ($Password))
{
$SecurePass = ConvertTo-SecureString -string $Password -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential $UserName, $SecurePass
# Check if RDP is enabled for the Service
$isRDPEnaled = Get-AzureServiceRemoteDesktopExtension -ServiceName $ServiceName
if(!$isRDPEnaled)
{
# Enable RDP with the new user
Set-AzureServiceRemoteDesktopExtension -ServiceName $ServiceName -Credential $Credential
}
else
{
if($isRDPEnaled.UserName -ne $UserName)
{
# Remove RDP for the existing user
Remove-AzureServiceRemoteDesktopExtension -ServiceName $ServiceName
# Enable RDP with the new user
Set-AzureServiceRemoteDesktopExtension -ServiceName $ServiceName -Credential $Credential
}
else
{
Write-Verbose ""
Write-Verbose " Remote Login enabled for the Service "
}
}
}