我无法使用服务主体对Azure Resource Manager进行身份验证。在问题排查过程中,我注意到Get-AzureADServicePrincipal
为我的服务主体显示AccountEnabled: False
,而Get-MsolServicePrincipal
显示AccountEnabled: True
为同一服务主体。
C:\Users\virklba> Get-AzureADServicePrincipal -SearchString azuremaint |fl
ServicePrincipalName : https://mycompany.com/AzureMaint
ApplicationId : 20bc779d-0edb-4a00-becf-952fda93edc5
AccountEnabled : False <-----------
DisplayName : AzureMaint
Id : 585cd6c7-403a-4940-9817-5139a254245e
Type :
C:\Users\virklba> Get-MsolServicePrincipal -ObjectId 585cd6c7-403a-4940-9817-5139a254245e
ExtensionData : System.Runtime.Serialization.ExtensionDataObject
AccountEnabled : True <-----------
Addresses : {Microsoft.Online.Administration.RedirectUri, Microsoft.Online.Administration.RedirectUri}
AppPrincipalId : 20bc779d-0edb-4a00-becf-952fda93edc5
DisplayName : AzureMaint
ObjectId : 585cd6c7-403a-4940-9817-5139a254245e
ServicePrincipalNames : {https://mycompany.com/AzureMaint, 20bc779d-0edb-4a00-becf-952fda93edc5}
TrustedForDelegation : False
我尝试过做Set-MsolServicePrincipal -ObjectId 585cd6c7-403a-4940-9817-5139a254245e -AccountEnabled $true
,但这并没有改变任何事情。没有Set-AzureADServicePrincipal
cmdlet
那么如何确保帐户真正启用?