"Add-AzureAccount" 收到错误:服务返回的与请求中的用户'XXX'不匹配



我在PowerShell中运行" add-azureAccount"命令时会出现错误:由服务返回的请求中的用户" xxx"与用户" xxx"不匹配。

步骤:打开powerShell =>输入" add-azureAccount" => Microsoft loin ui pop up =>输入我的广告电子邮件=>重定向到我的公司身份验证页面(adfs(=>输入我的密码=>显示错误

显示了
Add-AzureAccount : User 'xxx@carrier.utc.com' returned by service does not match user 'xxxxxx@UTCCGL.com' in the request
At line:1 char:1
+ Add-AzureAccount
+ ~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Add-AzureAccount], AadAuthenticationFailedException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.AddAzureAccount
Debug Log

DEBUG: 11:38:52 - AddAzureAccount begin processing with ParameterSet 'User'.
DEBUG: [Common.Authentication]: Authenticating using configuration values: Domain: 'Common', Endpoint: 'https://login.microsoftonline.
com/', ClientId: '**XXXXX**', ClientRedirect: 'urn:ietf:wg:oauth:2.0:oob', ResourceClientUri: 'https://mana
gement.core.windows.net/', ValidateAuthrity: 'True'
DEBUG: [Common.Authentication]: Acquiring token using context with Authority 'https://login.microsoftonline.com/Common/', CorrelationI
d: '00000000-0000-0000-0000-000000000000', ValidateAuthority: 'True'
DEBUG: [Common.Authentication]: Acquiring token using AdalConfiguration with Domain: 'Common', AdEndpoint: 'https://login.microsoftonl
ine.com/', ClientId: 'XXXXXX', ClientRedirectUri: urn:ietf:wg:oauth:2.0:oob
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 07/02/2019 03:38:57: 901cc9d7-c601-4f0b-9558-6a83b7ceddf5 - AcquireTokenHandlerBase: === Token Acquisition started:
    Authority: https://login.microsoftonline.com/Common/
    Resource: https://management.core.windows.net/
    ClientId: XXXXX
    CacheType: Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache (1 items)
    Authentication Target: User

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:38:57:  - WindowsFormsWebAuthenticationDialogBase: Navigating to 'https://login.microsoftonline.com/Common/oauth2
/authorize?resource=https://management.core.windows.net/&client_id=XXXXX&response_type=code&haschrome=1
&redirect_uri=urn:ietf:wg:oauth:2.0:oob&client-request-id=XXXXX&prompt=login&x-client-SKU=.NET&x-client
-Ver=2.28.3.860&x-client-CPU=x64&x-client-OS=Microsoft Windows NT 10.0.16299.0&site_id=501358&display=popup'.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:38:57:  - WindowsFormsWebAuthenticationDialogBase: Navigating to 'https://login.microsoftonline.com/Common/oauth2
/authorize?resource=https://management.core.windows.net/&client_id=XXXXX&response_type=code&haschrome=1
&redirect_uri=urn:ietf:wg:oauth:2.0:oob&client-request-id=XXXXX&prompt=login&x-client-SKU=.NET&x-client
-Ver=2.28.3.860&x-client-CPU=x64&x-client-OS=Microsoft Windows NT 10.0.16299.0&site_id=501358&display=popup&sso_nonce=AQABAAAAAADCoMpj
JXrxTq9VG9te-7FX-DwzfR6rI_XrfZdXD670F6R5VHRu4Ff-09tO6L2hWujlpsWpl8LnubUat_G1yfX59vZx3UoEDDnq7HMPvfVjViAA&mscrid=901cc9d7-c601-4f0b-955
8-6a83b7ceddf5'.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:38:58:  - WindowsFormsWebAuthenticationDialogBase: Navigated to 'https://login.microsoftonline.com/Common/oauth2/
authorize?resource=https://management.core.windows.net/&client_id=XXXXX&response_type=code&haschrome=1&
redirect_uri=urn:ietf:wg:oauth:2.0:oob&client-request-id=XXXXX&prompt=login&x-client-SKU=.NET&x-client-
Ver=2.28.3.860&x-client-CPU=x64&x-client-OS=Microsoft Windows NT 10.0.16299.0&site_id=501358&display=popup&sso_nonce=AQABAAAAAADCoMpjJ
XrxTq9VG9te-7FX-DwzfR6rI_XrfZdXD670F6R5VHRu4Ff-09tO6L2hWujlpsWpl8LnubUat_G1yfX59vZx3UoEDDnq7HMPvfVjViAA&mscrid=901cc9d7-c601-4f0b-9558
-6a83b7ceddf5'.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:38:58:  - WindowsFormsWebAuthenticationDialogBase: Navigating to 'https://login.live.com/Me.htm?v=1'.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:38:58:  - WindowsFormsWebAuthenticationDialogBase: Navigated to 'https://login.live.com/Me.htm?v=1'.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:39:11:  - WindowsFormsWebAuthenticationDialogBase: Navigating to 'https://fsaz.utcapp.com/adfs/ls/?wfresh=0&wauth
=http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/password&client-request-id=XXXXX
&username=XXX@utccgl.com&wa=wsignin1.0&wtrealm=urn:federation:MicrosoftOnline&wctx=LoginOptions=3&estsredirect=2&estsrequest=rQIIAePiM
tIzstAz1rMwMxBiNNRiNtQztFIxtDQ1SDQytdA1MjJP0jVJNTbUTbRMTtM1NzQ3sTS1NDFNSzbyYjM1MDQ2tSgS4hK4flJmAuMxbv-pEVnN28_d_TqJkbUgv6C0YBWjZGlRnlV
makmaVXm6VX5iaUmGlZGegVV-ftIORsYLjIwvGBlvMfH7OwIljEBEflFmVeorJtac_PTMvFXMKhklJQXFVvr6uYl5iempual5JXrJ-UWpeuWZeSn55cV6eakl-puY2ZLzc3Pz8
24wMz5i5isvrXAoLUlOTs8BKs29wML4ikWCg0lARoJZ4Q6bBosBsxUnB5cAg8TqegWGHyyMi1iBHuBYIbd7J9sL5xUdGz2qD0YwnGLVL09JDUgKTknMz6xMs6zQTsoIjSpMDfX
OTM01TsoJcvfwKi_11jd19_TTdrQ1tTKcwMZ4io1Fz8815AMbYwc7wy5O3F6_xSViZGBoqWtgrmtgpGBgbGVsaWVgEQUA0&cbcxt=&mkt=&lc='.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:39:13:  - WindowsFormsWebAuthenticationDialogBase: Navigated to 'https://fsaz.utcapp.com/adfs/ls/?wfresh=0&wauth=
http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/password&client-request-id=XXXXX
username=XXX@utccgl.com&wa=wsignin1.0&wtrealm=urn:federation:MicrosoftOnline&wctx=LoginOptions=3&estsredirect=2&estsrequest=rQIIAePiMt
IzstAz1rMwMxBiNNRiNtQztFIxtDQ1SDQytdA1MjJP0jVJNTbUTbRMTtM1NzQ3sTS1NDFNSzbyYjM1MDQ2tSgS4hK4flJmAuMxbv-pEVnN28_d_TqJkbUgv6C0YBWjZGlRnlVm
akmaVXm6VX5iaUmGlZGegVV-ftIORsYLjIwvGBlvMfH7OwIljEBEflFmVeorJtac_PTMvFXMKhklJQXFVvr6uYl5iempual5JXrJ-UWpeuWZeSn55cV6eakl-puY2ZLzc3Pz82
4wMz5i5isvrXAoLUlOTs8BKs29wML4ikWCg0lARoJZ4Q6bBosBsxUnB5cAg8TqegWGHyyMi1iBHuBYIbd7J9sL5xUdGz2qD0YwnGLVL09JDUgKTknMz6xMs6zQTsoIjSpMDfXO
TM01TsoJcvfwKi_11jd19_TTdrQ1tTKcwMZ4io1Fz8815AMbYwc7wy5O3F6_xSViZGBoqWtgrmtgpGBgbGVsaWVgEQUA0&cbcxt=&mkt=&lc='.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:41:27:  - WindowsFormsWebAuthenticationDialogBase: Navigating to 'https://fsaz.utcapp.com/adfs/ls/?wfresh=0&wauth
=http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/password&client-request-id=XXXXX
&username=XXX@utccgl.com&wa=wsignin1.0&wtrealm=urn:federation:MicrosoftOnline&wctx=LoginOptions=3&estsredirect=2&estsrequest=rQIIAePiM
tIzstAz1rMwMxBiNNRiNtQztFIxtDQ1SDQytdA1MjJP0jVJNTbUTbRMTtM1NzQ3sTS1NDFNSzbyYjM1MDQ2tSgS4hK4flJmAuMxbv-pEVnN28_d_TqJkbUgv6C0YBWjZGlRnlV
makmaVXm6VX5iaUmGlZGegVV-ftIORsYLjIwvGBlvMfH7OwIljEBEflFmVeorJtac_PTMvFXMKhklJQXFVvr6uYl5iempual5JXrJ-UWpeuWZeSn55cV6eakl-puY2ZLzc3Pz8
24wMz5i5isvrXAoLUlOTs8BKs29wML4ikWCg0lARoJZ4Q6bBosBsxUnB5cAg8TqegWGHyyMi1iBHuBYIbd7J9sL5xUdGz2qD0YwnGLVL09JDUgKTknMz6xMs6zQTsoIjSpMDfX
OTM01TsoJcvfwKi_11jd19_TTdrQ1tTKcwMZ4io1Fz8815AMbYwc7wy5O3F6_xSViZGBoqWtgrmtgpGBgbGVsaWVgEQUA0&cbcxt=&mkt=&lc='.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:41:29:  - WindowsFormsWebAuthenticationDialogBase: Navigating to 'https://fsaz.utcapp.com/adfs/ls/?wfresh=0&wauth
=http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/password&client-request-id=XXXXX
&username=XXX@utccgl.com&wa=wsignin1.0&wtrealm=urn:federation:MicrosoftOnline&wctx=LoginOptions=3&estsredirect=2&estsrequest=rQIIAePiM
tIzstAz1rMwMxBiNNRiNtQztFIxtDQ1SDQytdA1MjJP0jVJNTbUTbRMTtM1NzQ3sTS1NDFNSzbyYjM1MDQ2tSgS4hK4flJmAuMxbv-pEVnN28_d_TqJkbUgv6C0YBWjZGlRnlV
makmaVXm6VX5iaUmGlZGegVV-ftIORsYLjIwvGBlvMfH7OwIljEBEflFmVeorJtac_PTMvFXMKhklJQXFVvr6uYl5iempual5JXrJ-UWpeuWZeSn55cV6eakl-puY2ZLzc3Pz8
24wMz5i5isvrXAoLUlOTs8BKs29wML4ikWCg0lARoJZ4Q6bBosBsxUnB5cAg8TqegWGHyyMi1iBHuBYIbd7J9sL5xUdGz2qD0YwnGLVL09JDUgKTknMz6xMs6zQTsoIjSpMDfX
OTM01TsoJcvfwKi_11jd19_TTdrQ1tTKcwMZ4io1Fz8815AMbYwc7wy5O3F6_xSViZGBoqWtgrmtgpGBgbGVsaWVgEQUA0&cbcxt=&mkt=&lc='.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:41:31:  - WindowsFormsWebAuthenticationDialogBase: Navigating to 'https://fsaz.utcapp.com/adfs/ls/?wfresh=0&wauth
=http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/password&client-request-id=XXXXX
&username=XXX@utccgl.com&wa=wsignin1.0&wtrealm=urn:federation:MicrosoftOnline&wctx=LoginOptions=3&estsredirect=2&estsrequest=rQIIAePiM
tIzstAz1rMwMxBiNNRiNtQztFIxtDQ1SDQytdA1MjJP0jVJNTbUTbRMTtM1NzQ3sTS1NDFNSzbyYjM1MDQ2tSgS4hK4flJmAuMxbv-pEVnN28_d_TqJkbUgv6C0YBWjZGlRnlV
makmaVXm6VX5iaUmGlZGegVV-ftIORsYLjIwvGBlvMfH7OwIljEBEflFmVeorJtac_PTMvFXMKhklJQXFVvr6uYl5iempual5JXrJ-UWpeuWZeSn55cV6eakl-puY2ZLzc3Pz8
24wMz5i5isvrXAoLUlOTs8BKs29wML4ikWCg0lARoJZ4Q6bBosBsxUnB5cAg8TqegWGHyyMi1iBHuBYIbd7J9sL5xUdGz2qD0YwnGLVL09JDUgKTknMz6xMs6zQTsoIjSpMDfX
OTM01TsoJcvfwKi_11jd19_TTdrQ1tTKcwMZ4io1Fz8815AMbYwc7wy5O3F6_xSViZGBoqWtgrmtgpGBgbGVsaWVgEQUA0&cbcxt=&mkt=&lc=&ssoCookie=0d5c1e40-8d5b
-46eb-854e-e14c815542f5'.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:41:32:  - WindowsFormsWebAuthenticationDialogBase: Navigated to 'https://fsaz.utcapp.com/adfs/ls/?wfresh=0&wauth=
http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/password&client-request-id=XXXXX
username=XXX@utccgl.com&wa=wsignin1.0&wtrealm=urn:federation:MicrosoftOnline&wctx=LoginOptions=3&estsredirect=2&estsrequest=rQIIAePiMt
IzstAz1rMwMxBiNNRiNtQztFIxtDQ1SDQytdA1MjJP0jVJNTbUTbRMTtM1NzQ3sTS1NDFNSzbyYjM1MDQ2tSgS4hK4flJmAuMxbv-pEVnN28_d_TqJkbUgv6C0YBWjZGlRnlVm
akmaVXm6VX5iaUmGlZGegVV-ftIORsYLjIwvGBlvMfH7OwIljEBEflFmVeorJtac_PTMvFXMKhklJQXFVvr6uYl5iempual5JXrJ-UWpeuWZeSn55cV6eakl-puY2ZLzc3Pz82
4wMz5i5isvrXAoLUlOTs8BKs29wML4ikWCg0lARoJZ4Q6bBosBsxUnB5cAg8TqegWGHyyMi1iBHuBYIbd7J9sL5xUdGz2qD0YwnGLVL09JDUgKTknMz6xMs6zQTsoIjSpMDfXO
TM01TsoJcvfwKi_11jd19_TTdrQ1tTKcwMZ4io1Fz8815AMbYwc7wy5O3F6_xSViZGBoqWtgrmtgpGBgbGVsaWVgEQUA0&cbcxt=&mkt=&lc=&ssoCookie=0d5c1e40-8d5b-
46eb-854e-e14c815542f5'.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:41:32:  - WindowsFormsWebAuthenticationDialogBase: Navigating to 'https://login.microsoftonline.com/login.srf?cli
ent-request-id=XXXXX'.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:41:33:  - WindowsFormsWebAuthenticationDialogBase: WebBrowser state: IsBusy: True, ReadyState: Complete, Created:
 True, Disposing: False, IsDisposed: False, IsOffline: False
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:41:33:  - WindowsFormsWebAuthenticationDialogBase: WebBrowser state (after Stop): IsBusy: False, ReadyState: Comp
lete, Created: True, Disposing: False, IsDisposed: False, IsOffline: False
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:41:34: XXXXX - TokenCache: Storing token in the cache...
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:41:34: XXXXX - TokenCache: An item was stored in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 07/02/2019 03:41:34: XXXXX - AcquireTokenHandlerBase: === Token Acquisition finished successfull
y. An access token was retuned:
    Access Token Hash: XXXXX
    Refresh Token Hash: U80lp4/LTmBKc3Xh5hYpWpdfaTe2hbxSxvtD4PDMVqk=
    Expiration Time: 07/02/2019 04:41:34 +00:00
    User Hash: XXXXX

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 07/02/2019 03:41:34:  - TokenCache: Serializing token cache with 1 items.
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
GET
Absolute Uri:
https://management.core.windows.net/subscriptions
Headers:
x-ms-version                  : 2013-08-01
Body:

DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
OK
Headers:
x-ms-servedbyregion           : ussouth3
x-ms-request-id               : d1d99bf68fc0aa77953c90dc85c56894
Cache-Control                 : no-cache
Date                          : Tue, 02 Jul 2019 03:41:35 GMT
Server                        : 67.3.0.175/release1,(c937119),Microsoft-HTTPAPI/2.0
Body:
<Subscriptions xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <Subscription>
    <SubscriptionID>XXXX</SubscriptionID>
    <SubscriptionName>XXXX</SubscriptionName>
    <SubscriptionStatus>Active</SubscriptionStatus>
    <AccountAdminLiveEmailId>XXXXX@outlook.com</AccountAdminLiveEmailId>
    <ServiceAdminLiveEmailId>XXXXX@outlook.com</ServiceAdminLiveEmailId>
    <MaxCoreCount>350</MaxCoreCount>
    <MaxStorageAccounts>100</MaxStorageAccounts>
    <MaxHostedServices>20</MaxHostedServices>
    <CurrentCoreCount>0</CurrentCoreCount>
    <CurrentHostedServices>0</CurrentHostedServices>
    <CurrentStorageAccounts>0</CurrentStorageAccounts>
    <MaxVirtualNetworkSites>100</MaxVirtualNetworkSites>
    <MaxLocalNetworkSites>20</MaxLocalNetworkSites>
    <MaxDnsServers>20</MaxDnsServers>
    <OfferCategories>Azure_Platform_All;Azure_Paid;Azure_Consumption;Azure_EA;Azure_MS-AZR-0017P;Individual</OfferCategories>
    <MaxExtraVIPCount>-1</MaxExtraVIPCount>
    <AADTenantID>XXXXX</AADTenantID>
    <CreatedTime>2018-09-27T06:41:39Z</CreatedTime>
  </Subscription>
  <Subscription>
    <SubscriptionID>XXXXX</SubscriptionID>
    <SubscriptionName>XXX</SubscriptionName>
    <SubscriptionStatus>Active</SubscriptionStatus>
    <AccountAdminLiveEmailId>XXXX@outlook.com</AccountAdminLiveEmailId>
    <ServiceAdminLiveEmailId>XXXXX@outlook.com</ServiceAdminLiveEmailId>
    <MaxCoreCount>350</MaxCoreCount>
    <MaxStorageAccounts>100</MaxStorageAccounts>
    <MaxHostedServices>20</MaxHostedServices>
    <CurrentCoreCount>0</CurrentCoreCount>
    <CurrentHostedServices>0</CurrentHostedServices>
    <CurrentStorageAccounts>0</CurrentStorageAccounts>
    <MaxVirtualNetworkSites>100</MaxVirtualNetworkSites>
    <MaxLocalNetworkSites>20</MaxLocalNetworkSites>
    <MaxDnsServers>20</MaxDnsServers>
    <OfferCategories>Azure_Platform_All;Azure_Paid;Azure_Consumption;Azure_EA;Azure_MS-AZR-0017P;Individual</OfferCategories>
    <MaxExtraVIPCount>-1</MaxExtraVIPCount>
    <AADTenantID>XXXXX</AADTenantID>
    <CreatedTime>2018-11-12T01:32:21Z</CreatedTime>
  </Subscription>
  <Subscription>
    <SubscriptionID>XXXXX</SubscriptionID>
    <SubscriptionName>XXXX</SubscriptionName>
    <SubscriptionStatus>Active</SubscriptionStatus>
    <AccountAdminLiveEmailId>XXXX@outlook.com</AccountAdminLiveEmailId>
    <ServiceAdminLiveEmailId>XXXX@outlook.com</ServiceAdminLiveEmailId>
    <MaxCoreCount>350</MaxCoreCount>
    <MaxStorageAccounts>100</MaxStorageAccounts>
    <MaxHostedServices>20</MaxHostedServices>
    <CurrentCoreCount>0</CurrentCoreCount>
    <CurrentHostedServices>0</CurrentHostedServices>
    <CurrentStorageAccounts>0</CurrentStorageAccounts>
    <MaxVirtualNetworkSites>100</MaxVirtualNetworkSites>
    <MaxLocalNetworkSites>20</MaxLocalNetworkSites>
    <MaxDnsServers>20</MaxDnsServers>
    <OfferCategories>Azure_Platform_All;Azure_Paid;Azure_Consumption;Azure_EA;Azure_MS-AZR-0017P;Individual</OfferCategories>
    <MaxExtraVIPCount>-1</MaxExtraVIPCount>
    <AADTenantID>XXXXX</AADTenantID>
    <CreatedTime>2018-08-28T02:42:13Z</CreatedTime>
  </Subscription>
  <Subscription>
    <SubscriptionID>XXXX</SubscriptionID>
    <SubscriptionName>XXXXX</SubscriptionName>
    <SubscriptionStatus>Active</SubscriptionStatus>
    <AccountAdminLiveEmailId>XXX@UTCCGL.com</AccountAdminLiveEmailId>
    <ServiceAdminLiveEmailId>XXX@UTCCGL.com</ServiceAdminLiveEmailId>
    <MaxCoreCount>350</MaxCoreCount>
    <MaxStorageAccounts>100</MaxStorageAccounts>
    <MaxHostedServices>20</MaxHostedServices>
    <CurrentCoreCount>0</CurrentCoreCount>
    <CurrentHostedServices>0</CurrentHostedServices>
    <CurrentStorageAccounts>0</CurrentStorageAccounts>
    <MaxVirtualNetworkSites>100</MaxVirtualNetworkSites>
    <MaxLocalNetworkSites>20</MaxLocalNetworkSites>
    <MaxDnsServers>20</MaxDnsServers>
    <OfferCategories>Azure_Platform_All;Azure_Paid;Azure_Consumption;Azure_EA;Azure_MS-AZR-0017P;Individual</OfferCategories>
    <MaxExtraVIPCount>-1</MaxExtraVIPCount>
    <AADTenantID>XXXXXXXXX</AADTenantID>
    <CreatedTime>2019-05-13T02:58:34Z</CreatedTime>
  </Subscription>
</Subscriptions>

DEBUG: [Common.Authentication]: Authenticating using configuration values: Domain: 'XXXXX', Endpoint: '
https://login.microsoftonline.com/', ClientId: 'XXXX', ClientRedirect: 'urn:ietf:wg:oauth:2.0:oob', Re
sourceClientUri: 'https://management.core.windows.net/', ValidateAuthrity: 'True'
DEBUG: [Common.Authentication]: Acquiring token using context with Authority 'https://login.microsoftonline.com/f4841380-e7f4-4f8b-9d3
f-525914ae311d/', CorrelationId: '00000000-0000-0000-0000-000000000000', ValidateAuthority: 'True'
DEBUG: [Common.Authentication]: Acquiring token using AdalConfiguration with Domain: 'f4841380-e7f4-4f8b-9d3f-525914ae311d', AdEndpoin
t: 'https://login.microsoftonline.com/', ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', ClientRedirectUri: urn:ietf:wg:oauth:2.0:oo
b
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 07/02/2019 03:41:36: ddba4a62-c19a-462d-bdda-174ad69a7b7a - AcquireTokenHandlerBase: === Token Acquisition started:
    Authority: https://login.microsoftonline.com/f4841380-e7f4-4f8b-9d3f-525914ae311d/
    Resource: https://management.core.windows.net/
    ClientId: XXXXX
    CacheType: Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache (1 items)
    Authentication Target: User

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:41:36: XXXX - TokenCache: Looking up cache for a token...
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 07/02/2019 03:41:36: XXXXX - TokenCache: No matching token was found in the cache
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:41:36:  - WindowsFormsWebAuthenticationDialogBase: Navigating to 'https://login.microsoftonline.com/f4841380-e7f4
-4f8b-9d3f-525914ae311d/oauth2/authorize?resource=https://management.core.windows.net/&client_id=XXXX
response_type=code&haschrome=1&redirect_uri=urn:ietf:wg:oauth:2.0:oob&login_hint=WUX@UTCCGL.com&client-request-id=XXXXX&prompt=attempt_none&x-client-SKU=.NET&x-client-Ver=2.28.3.860&x-client-CPU=x64&x-client-OS=Microsoft Windows NT 10.0.
16299.0&site_id=501358&display=popup'.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 07/02/2019 03:41:37:  - WindowsFormsWebAuthenticationDialogBase: Navigating to 'https://login.microsoftonline.com/XXXX/oauth2/authorize?resource=https://management.core.windows.net/&client_id=XXXXX
response_type=code&haschrome=1&redirect_uri=urn:ietf:wg:oauth:2.0:oob&login_hint=XXX@UTCCGL.com&client-request-id=XXXXX&prompt=attempt_none&x-client-SKU=.NET&x-client-Ver=2.28.3.860&x-client-CPU=x64&x-client-OS=Microsoft Windows NT 10.0.
16299.0&site_id=501358&display=popup&sso_nonce=AQABAAAAAADCoMpjJXrxTq9VG9te-7FXACiy4PAt-bgXL2BHSIuPj0VUe1VyjXdxXb8cpsLvAGzOmy1o8kJ0QfZ
OH1zopd9MgnCPQkOVELD4N_ndC8w4vCAA&mscrid=ddba4a62-c19a-462d-bdda-174ad69a7b7a'.
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Error: 4 : 
DEBUG: 07/02/2019 03:41:39:XXXXX - <RunAsync>d__0: Microsoft.IdentityModel.Clients.ActiveDirectory.Ada
lUserMismatchException: User 'XXXXX@carrier.utc.com' returned by service does not match user 'XXX@UTCCGL.com' in the request
   at Microsoft.IdentityModel.Clients.ActiveDirectory.AcquireTokenInteractiveHandler.PostTokenRequest(AuthenticationResult result)
   at Microsoft.IdentityModel.Clients.ActiveDirectory.AcquireTokenHandlerBase.<RunAsync>d__0.MoveNext()
    ErrorCode: user_mismatch
    RequestedUser: XXX@UTCCGL.com
    ReturnedUser: XXXXX@carrier.utc.com
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 07/02/2019 03:41:39:  - TokenCache: Serializing token cache with 1 items.
Add-AzureAccount : User 'XXXXX@carrier.utc.com' returned by service does not match user 'XXX@UTCCGL.com' in the request
At line:1 char:1
+ Add-AzureAccount -Debug
+ ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Add-AzureAccount], AadAuthenticationFailedException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.AddAzureAccount
DEBUG: AzureQoSEvent: CommandName - Add-AzureAccount; IsSuccess - False; Duration - 00:02:50.2749847; Exception - Microsoft.Azure.Comm
ands.Common.Authentication.AadAuthenticationFailedException: User 'XXXXX@carrier.utc.com' returned by service does not match user 'XX
X@UTCCGL.com' in the request ---> Microsoft.IdentityModel.Clients.ActiveDirectory.AdalUserMismatchException: User 'XXXXX@carrier.utc.
com' returned by service does not match user 'XXX@UTCCGL.com' in the request
   at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.RunAsyncTask[T](Task`1 task)
   at Microsoft.Azure.Commands.Common.Authentication.UserTokenProvider.DoAcquireToken(AdalConfiguration config, PromptBehavior promptB
ehavior, Action`1 promptAction, String userId, SecureString password)
   at Microsoft.Azure.Commands.Common.Authentication.UserTokenProvider.SafeAquireToken(AdalConfiguration config, String showDialog, Ac
tion`1 promptAction, String userId, SecureString password, Exception& ex)
   --- End of inner exception stack trace ---
   at Microsoft.Azure.ServiceManagemenet.Common.ProfileClient.WriteOrThrowAadExceptionMessage(AadAuthenticationException aadEx)
   at Microsoft.Azure.ServiceManagemenet.Common.ProfileClient.ListSubscriptionsFromServer(IAzureAccount account, IAzureEnvironment env
ironment, SecureString password, String promptBehavior, Action`1 promptAction)
   at Microsoft.Azure.ServiceManagemenet.Common.ProfileClient.AddAccountAndLoadSubscriptions(IAzureAccount account, IAzureEnvironment 
environment, SecureString password)
   at Microsoft.WindowsAzure.Commands.Profile.AddAzureAccount.ExecuteCmdlet()
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord();
DEBUG: Finish sending metric.
DEBUG: 11:41:43 - AddAzureAccount end processing.
DEBUG: 11:41:43 - AddAzureAccount end processing.

尝试使用PowerShell版本 5.1.14393.1198 重现相同的问题,并能够重现它。

我能够通过使用 Remove-AzureAccount 首先删除帐户来解决,然后再次添加该帐户,然后使用" **Add-AzureAccount**"命令选择个人帐户。

请尝试查看是否有帮助。如果仍然不起作用,请告诉我并提供详细的详细日志,将能够进一步帮助您。

您必须手动删除个人资料(Clear-AzureProfile也将失败(。删除 - 项目" $ env:userprofile appdata roaming windows azure powershell"

注意:系统重新启动比仅进行必要的更改

需要

请用命令" $ psversiontable.psversion"检查PS如果不是5.1,请按照文档中的步骤https://learn.microsoft.com/en-us/powershell/scripting/install/install/installing-windows-powershell?view = powershell-6更新它,然后选择WFM 5.1,然后选择WFM 5.1.NET框架必须更新为.NET Framework 4.7.2版本https://dotnet.microsoft.com/download/dotnet-framework-runtime安装PS后,然后再次安装模块安装模块-Name AZ -AllowClobber默认情况下,PowerShell画廊未配置为PowerShellget的可信存储库。第一次使用psgallery时,您会看到以下提示:再次添加帐户由@mohit Verma

提出。

最新更新