4 天前(2014 年 8 月 4 日)发布了 Azure Powershell 的新版本,其中包括一个新的-凭据Add-AzureAccount cmdlet 上的参数。我正在尝试使用它,但显然我做错了什么。
首先,我将密码存储在一个文件中:
read-host -assecurestring | convertfrom-securestring | out-file C:\temp\securestring.txt
然后尝试在 Add-AzureAccount 中使用它
$password = cat C:\temp\securestring.txt | convertto-securestring
$username = "dhdom1\jamiet" #yes, this is the correct username
$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username,$password
Add-AzureAccount -credential $mycred
对 Add-AzureAccount 的调用失败:
Add-AzureAccount : user_realm_discovery_failed: 用户领域发现
失败:远程服务器返回错误:(404) 未找到。
我知道“dhdom1\jamiet”是正确的帐户。有人知道为什么这可能会失败吗? TIA
您应该使用用于登录 Azure 门户的组织帐户。所以,它可能看起来像果酱[电子邮件受保护] /cdn-cgi/l/email-protection, 或类似的东西。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)