Get-AzTenant
Retrieves information about Azure tenants.
SYNOPSIS
Retrieves information about Azure tenants.
SYNTAX
Get-AzTenant [-TenantId ] [-DefaultProfile ] []
DESCRIPTION
The Get-AzTenant cmdlet retrieves information about the Azure tenants that the current user can access. A tenant is a dedicated instance of Azure Active Directory (Azure AD) that a company or large organization uses to get and manage access to Microsoft cloud resources.
By default, this cmdlet returns all tenants that the current user can access. You can filter the results by using the TenantId parameter.
PARAMETERS
-TenantId: Specifies the ID of the tenant to retrieve. If not specified, the cmdlet returns all tenants.
String
-DefaultProfile: The credentials, account, tenant, and subscription used for communication with Azure.
IAzureContextContainer
-WhatIf: Performs the operation but does not make the change.
SwitchParameter
-Confirm: Prompts you for confirmation before running the cmdlet.
SwitchParameter
INPUTS
None. You can pipe objects to this cmdlet.
OUTPUTS
Microsoft.Azure.Commands.Tenant.Models.PSObjectTenant
This cmdlet returns a tenant object that contains the following properties:
- TenantId: The unique identifier of the tenant.
- DisplayName: The display name of the tenant.
- Domains: A list of domains associated with the tenant.
EXAMPLES
Example 1: Get all tenants
This command retrieves all tenants that the current user can access.
Get-AzTenant
Example 2: Get a specific tenant by ID
This command retrieves a specific tenant using its Tenant ID.
Get-AzTenant -TenantId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"