Gerenios / AADInternals

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

Fix type mismatch in Get-TenantDomains #92

Open csandker opened 1 month ago

csandker commented 1 month 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