> For the complete documentation index, see [llms.txt](https://www.techwithtyler.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.techwithtyler.dev/cloud-security/azure/azure-offensive-security/azure-attacks-and-techniques/discover-if-domain-associated-with-entra-id-microsoft-365.md).

# Discover if Domain Associated with Entra ID / Microsoft 365

## Overview

* We can check a particular Microsoft URL to determine if a domain is associated with Entra ID or Microsoft 365 (office)
* In the output, look for the `NameSpaceType` field and inspect the value:
  * `Managed` — domain is an Azure AD tenant
  * `Federated` — domain is associated with an Azure AD tenant but leverages a federation service e.g., Okta, PingID, Active Directory, etc.&#x20;
  * `Unknown` — domain not associated with Azure AD tenant

### View with Web Browser

<div data-with-frame="true"><figure><img src="/files/g8oQxoOawno6YncYCvVI" alt=""><figcaption></figcaption></figure></div>

### View with curl

{% code overflow="wrap" %}

```zsh
curl -s 'https://login.microsoftonline.com/getuserrealm.srf?login=<domain-url>&xml=1' | xmllint --format -
```

{% endcode %}

### View with PowerShell

{% embed url="<https://aadinternals.com/aadinternals/>" %}

{% code overflow="wrap" %}

```zsh
brew install powershell
```

{% endcode %}

```powershell
pwsh
Install-Module -Name AADInternals
Import-Module -Name AADInternals
Get-AADIntLoginInformation -Domain <domain-url>
```

***

## Additional Resources

{% embed url="<https://learn.microsoft.com/en-us/archive/blogs/tip_of_the_day/cloud-tip-of-the-day-advanced-way-to-check-domain-availability-for-office-365-and-azure>" %}
