PowerGUI script that displays Exchange 2003 SMTP addresses

jahhan
jahhan used Ask the Experts™
on
I am in the need of a powershell script that will display the SMTP addresses of Exchange mailboxes.  The script I currently have displays every assigned SMTP address; however, I'm looking for a script that excludes X400 addresses.

Current Script:
Get-QADUser -IncludedProperties proxyAddresses | Format-Table Name, emailaddress, proxyaddress
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:

Here's an alternative;
ldifde -f smtpaddresses.txt -d "dc=domain,dc=com, -l proxyaddresses -r "(proxyaddresses=*)"
PowerShell Developer
Top Expert 2010
Commented:

You'd have to filter the return value. This should do it:

Get-QADUser -IncludedProperties proxyAddresses | `
  Select-Object Name, EmailAddress, @{n="EmailAddresses";e={ $_.proxyAddresses | ?{ $_ -Like "smtp:*" }}} | `
  Format-Table

HTH

Chris

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial