Posts Tagged ‘Azure’
Master the Lookup – Microsoft AAD/EntraID get all Tenant and Azure Subscription Details
14. Oktober 2023
Hinterlasse einen Kommentar
Do you ever find yourself in a situation where you need to match an ID to its corresponding name in Microsoft Partner Center, Azure, or M365? Or perhaps you need to do the reverse? Here are some quick solutions:
1) Looking up TenantID from DNS-Name
- Simply visit https://www.whatismytenantid.com/ and enter the DNS-Name.
2) Looking up DNS-Name from TenantID (for tenants you have no access)
- You can use MSGraph Explorer and the „findTenantInformationByTenantId“ API at: https://graph.microsoft.com/beta/tenantRelationships/findTenantInformationByTenantId(tenantId=’XYZ‘).
3) Getting TenantID for SubscriptionID (for subscriptions you have no access)
- You can achieve this using Azure API, e.g., with PowerShell. Find the detailed guide at: https://www.lieben.nu/liebensraum/2020/08/get-tenant-id-using-azure-subscription-id/. Here’s a PowerShell function to get the TenantID from SubscriptionID:
function get-tenantIdFromSubscriptionID($subId){
$response = try {
(Invoke-WebRequest -UseBasicParsing -Uri "https://management.azure.com/subscriptions/$($subId)?api-version=2015-01-01" -ErrorAction Stop).BaseResponse
} catch {
$_.Exception.Response
}
$stringHeader = $response.Headers.ToString()
return ($stringHeader.SubString($stringHeader.IndexOf("login.windows.net") + 18, 36))
}
These handy tools and methods will help you master the art of matching IDs with their corresponding names in the Microsoft Azure ecosystem.