我使用PowerShell脚本来启动azure自动化,它在名称上释放vm:
$clientID = "..."
$key = "..."
$SecurePassword = $key | ConvertTo-SecureString -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $clientID, $SecurePassword
Add-AzureRmAccount -Credential $cred -Tenant "..." -ServicePrincipal
$params = @{"RESOURCEGROUPNAME" = "..."; "VMNAME" = $env:computername}
Start-AzureRmAutomationRunbook -ResourceGroupName "..." -AutomationAccountName "..." -Name "StopAzureV2Vm" -Parameters $params但从Jule/22命令AzureRmAccount.启动抛出错误:
AzureRmAccount: AADSTS1002016:您正在使用TLS版本1.0、1.1和/或3 3DES密码,这些密码被废弃以改善Azure的安全态势。您的TenantID是: 7441e116-ef50-4bf6-a98f-1fa0671ccfb5。请参考https://go.microsoft.com/fwlink/?linkid=2161187,并采取必要的行动来解决这个问题。如有进一步问题,请与您的管理员联系。
请帮助重写我的代码以适应新的需求?
发布于 2022-08-01 12:17:29
您可以按照以下方法来解决这个问题:
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;参考MSDOC解决TLS1.0问题
https://stackoverflow.com/questions/73181795
复制相似问题