How to Export GAL from Exchange 2007
Hi everybody, somebody knows how can I export GAL contacts from all my organization to a file like (.txt,csv,so on)I have exchange server 2007, with several domains and I need to export all the contacts or mailbox users on the entire organization.Is there a way to do this?Do I need permission to do this , If I'm located on child domain?Thanks!JASM
September 23rd, 2009 11:27pm

You will need permissions in the Exchange organization. Not sure if Exchange View Only Administrator will suffice, or if you need to be an Exchange Recipient Administrator. Anyhow, these permissions are forest-wide and comprise the whole organization.Not exactly sure what you mean: "export GAL", "export GAL contacts" and then "export all the contacts or mailbox users."The GAL consists of all recipients. So this command will return all recipients:Get-RecipientThese recipients consist of UserMailbox, MailContact, MailUniversalDistributionGroup, PublicFolderThat's my machine. PublicFolder refers to mail-enabled public folders. You might in addition have mail-enabled users and other types of distributions groups. To export them to a .csv file:Get-Recipient | Export-CSV -Encoding Unicode c:\temp\recipients.csvIf you think way too much information is returned and you are only interested in Name and Primary SMTP Address:Get-Recipient | Select-Object Name, PrimarySmtpAddress | Export-CSV -Encoding Unicode c:\temp\recipients.csvIf you want to export mailbox and mail contact object:Get-Recipient | Where-Object {$_.RecipientType -eq 'UserMailbox' -or $_.RecipientType -eq 'MailContact'} Then select your objects and export it.Hope this helps.jas
Free Windows Admin Tool Kit Click here and download it now
September 24th, 2009 6:16am

Thanks Jon:When I said export GAL I was talking that needed the following information.Name SMTPUser 1 user1@contoso.comUser 1 user2@another.com...Let me try with your suggestions I think that I would be enough.Thanks!JASM
September 24th, 2009 7:08am

Good to hear. The logic is as follows.First doGet-Recipient(Ctrl+C to break if too much is returned.) This gives you a general overviewSelect one Name and see what type of information you getGet-Recipient *jon-alfred* | fl Then use only some of the Fields:Get-Recipient *jon-alfred* | Select-Object Name, PrimarySMTPAddress, RecipientTypeYou see that every recipient has a RecipientType, and you can do a filter. That's where the where clause comes in.The -Encoding Unicode might not be necessary for you, but it is in Norway with , , ...jas
Free Windows Admin Tool Kit Click here and download it now
September 24th, 2009 7:25am

Hi Jon I perfomed your suggestions and works ok.But I need the following.When I type the commands that you recommended received the following information:User EmailThat's fine , but I just can see the user's information that are located on my exchange server but my organization has many exchange servers, so I need to be able display or export other users.I as running from a child domain.I need to run from the root domain with appropiate credentials to make this task?That's why I'm trying to export GAL to have all the contacts on my entire organization,JASM
September 24th, 2009 8:29pm

By default powershell runs under the scope of domain where it is opened, you need to change the recipient scope to whole organization instead of child domain... How to Change the Recipient Scope http://technet.microsoft.com/en-us/library/bb124791.aspxAmit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
September 24th, 2009 8:45pm

Highly interesting. Was not aware of the recipient scope. However, I just forgot this parameter, which you may need for organizations with more than 1000 recipients, just forgot it: -ResultSize unlimited.So you would either need to enter this command first:$AdminSessionADSettings.ViewEntireForest = $True Or you could add it as a parameter to the Get-Recipient command:Get-Recipient -IgnoreDefaultScope -ResultSize unlimitedBTW, just noticed after a Get-Help Get-Recipient:To run the Get-Recipient cmdlet, the account you use must be delegated the following: * Exchange View-Only Administrator rolejas
September 25th, 2009 12:17am

This article is no longer available. An updated refrence would be helpful please.Deanna McNeil
Free Windows Admin Tool Kit Click here and download it now
October 29th, 2010 12:15pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics