< Back

Get-AADIntTenantDomains

Fri Jan 10, 2020 5:52 pm

NAME Get-AADIntTenantDomains



SYNOPSIS

Gets other domains from the tenant of the given domain





SYNTAX

Get-AADIntTenantDomains -Credentials <PSCredential> -Domain <String> [<CommonParameters>]



Get-AADIntTenantDomains -AccessToken <String> -Domain <String> [<CommonParameters>]





DESCRIPTION

Uses Exchange Online "feature" that allows Get-FederationInformation cmdlet to retrive other

domains from the tenant of the given domain. The tenant used to retrieve information can

be any tenant having Exchange Online, including trial tenants.

The given user MUST have GlobalAdmin / CompanyAdministrator role in the tenant running the function,

but no rights to the target tenant is needed.



Due to Exchange Online, this function is extremely slow, can take 10 seconds or more to complete.



The given domain SHOULD be Managed, federated domains are not always found for some reason.

If nothing is found, try to use <domain>.onmicrosoft.com





PARAMETERS

-Credentials <PSCredential>



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-AccessToken <String>



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Domain <String>



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-AADIntTenantDomains -Credentials $Cred -Domain company.com



company.com

company.fi

company.co.uk

company.onmicrosoft.com

company.mail.onmicrosoft.com









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>$at = Get-AADIntAccessTokenForEXO



PS C:\\>Get-AADIntTenantDomains -AccessToken $at -Domain company.com



company.com

company.fi

company.co.uk

company.onmicrosoft.com

company.mail.onmicrosoft.com











RELATED LINKS