question

bwalley21stnet-3038 avatar image
0 Votes"
bwalley21stnet-3038 asked MarileeTurscak-MSFT commented

Different Tenant ID showing on PowerShell than on Portal

When I log into portal.azure.com and view the tenant id it shows one thing. I can navigate around and do things as expected.

When I use powershell and connect-azuread it returns with a different tenant id and no commands seem to work.

Using my global admin account. Same ID and password. This is an account that was set up to do training and testing.

Any ideas as to the disconnect? Am I missing something?

azure-ad-tenant
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MarileeTurscak-MSFT avatar image
1 Vote"
MarileeTurscak-MSFT answered MarileeTurscak-MSFT commented

Make sure you specify a tenant ID in the request.

Try:

 Connect-AzureAD -TenantId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

If you just use Connect-AzureAD , the TenantDomain will be "User" and it may pull up the wrong tenant.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you. That does work. Will this be required every time? Where is the other TenantID coming from? Any help is appreciated.

0 Votes 0 ·

If you do not specify this parameter, the account is authenticated with the home tenant. You always need to specify the TenantId parameter to authenticate as a service principal or when using Microsoft account.

https://docs.microsoft.com/en-us/powershell/module/azuread/connect-azuread?view=azureadps-2.0


0 Votes 0 ·