Gerenios / AADInternals

AADInternals PowerShell module for administering Azure AD and Office 365
http://aadinternals.com/aadinternals
MIT License
1.3k stars 217 forks source link

Fix type mismatch in Get-TenantDomains #92

Closed csandker closed 5 days ago

csandker commented 5 months ago

When the Get-TenantDomains function in AccessToken_Utils.ps1 only returns a single domain a string value is returned for the assigned $domains variable.

$domains = $response.Envelope.body.GetFederationInformationResponseMessage.response.Domains.Domain

This could cause a wrong concatenation in the following code block

if($Domain -notin $domains)
{
    $domains += $Domain
}

This in turn will ruin all subsequent checks as the the returned $domains is an incorrect concatenated string, instead of being an Array. This will cause AADInternals to show false information.

Applied Fix: Ensure $domains is always a StringArray