Sébastien,
Keep in mind that an alias can be configured to point to all domain users with no listed targets. For the API call you are using, you should be able to check that setting based on the includeAllDomainUsers property for each alias. The script you posted would incorrectly identify aliases with that configuration as empty.
Andrew Barker
Senior Software Developer
SmarterTools Inc.
www.smartertools.com