none
Export Global Address Book from the Exchange PowerShell Excluding Hidden Mailboxes

    Question

  • Hello,

    I have an Exchange 2010 server. I would like to export the Global Address List EXCLUDING the hidden mailboxes. Is there a way to do this?

    Thanks!!!

    Ez

    Friday, February 7, 2014 4:52 PM

Answers

  • Hi,

    Please try the following commands:

    $filter = (Get-GlobalAddressList 'Default Global Address List').RecipientFilter

    Get-Recipient -RecipientPreviewFilter $filter | Where-Object {$_.HiddenFromAddressListsEnabled -ne $false} | Select-Object Name,PrimarySmtpAddress | Export-CSV c:\GAL.csv -NoTypeInformation

    Thanks,


    Winnie Liang
    TechNet Community Support

    Tuesday, February 11, 2014 4:19 PM
    Moderator

All replies

  • Off the top of my head...If you are looking for just name, phone and email addresses you can do:

    get-mailbox -resultsize unlimited | ?{$_.HiddenFromAddressListsEnabled -eq $false} | get-user | select DisplayName,Phone,WindowsEmailAddress | export-csv c:\GAL-Export.csv -NoTypeInformation

    This is providing you have 1 email address per person.  If you have multiple email addresses and want to display them, it gets a little more complicated.

    If you want to add more information for the users in the csv file just add what fields you want in the "select" section. These would have to be fields available when you do a get-user command.

    Friday, February 7, 2014 8:16 PM
  • Hi,

    Please try the following commands:

    $filter = (Get-GlobalAddressList 'Default Global Address List').RecipientFilter

    Get-Recipient -RecipientPreviewFilter $filter | Where-Object {$_.HiddenFromAddressListsEnabled -ne $false} | Select-Object Name,PrimarySmtpAddress | Export-CSV c:\GAL.csv -NoTypeInformation

    Thanks,


    Winnie Liang
    TechNet Community Support

    Tuesday, February 11, 2014 4:19 PM
    Moderator
  • Bumping this thread..the above doesn't work. error says 
    'Cannot validate argument on parameter 'RecipientPreviewFilter'. The argument is null or empty. Supply an argument that is not null or empty and then try the command again'

    Can anyone try to correct?

    Monday, June 25, 2018 4:55 PM