Private/Permissions/Hashtable/Get-ADHashDisplayName.ps1

Function Get-ADHashDisplayName {

    param (
        [parameter(ValueFromPipeline = $true)]
        $ADUserList
    )
    begin {
        $ADHashDisplayName = @{ }
    }
    process {
        foreach ($ADUser in $ADUserList) {
            $ADHashDisplayName[$ADUser.DisplayName] = @{
                UserPrincipalName          = $ADUser.UserPrincipalName
                PrimarySMTPAddress         = $ADUser.PrimarySMTPAddress
                msExchRecipientTypeDetails = $ADUser.msExchRecipientTypeDetails
                msExchRecipientDisplayType = $ADUser.msExchRecipientDisplayType
                Logon                      = $ADUser.Logon
                objectClass                = $ADUser.objectClass
            }
        }
    }
    end {
        $ADHashDisplayName
    }
}