Query contacts from Exchange 2010?
I'm looking for a way of pulling users contacts email addresses out of Exchange 2010 SP1 at the server.
Can this be done with a powershell query? Or can this even be done at all?
June 13th, 2011 12:33pm
Explain please
Contacts that users has in their profiles or contacts you have in AD?
Free Windows Admin Tool Kit Click here and download it now
June 13th, 2011 1:15pm
Explain please
Contacts that users has in their profiles or contacts you have in AD?
Contacts that users have.
June 13th, 2011 1:17pm
contacts that users have are part of Outlook and do not get ported over to the server. You best bet is to export the contacts from outlook to a pst or excel file. Automate the export if you have a lot of users.
Free Windows Admin Tool Kit Click here and download it now
June 13th, 2011 3:47pm
contacts that users have are part of Outlook and do not get ported over to the server.
How is this true? If a users PC with Outlook installed fails, when the user re-attaches with OWA or a new PC their contacts are available from the Server.
I am asking if there is a way to pull out the email addresses from user contacts ON Exchange. If Outlook has to be used, that's fine, HOW do you do it for all users and just the email addresses of their contacts?
June 13th, 2011 3:54pm
Your right....brain freeze
Export-mailbox would allow you to export just the contacts.
http://technet.microsoft.com/en-us/library/aa998579.aspx
Once the export is done then some other tool to extract the email addresses.
I think export to excel from outlook client would be easier to manipulate the data you need.
Free Windows Admin Tool Kit Click here and download it now
June 13th, 2011 4:01pm
Hi,
Agree with LMurthy and this the third party tool may help you:
http://www.emailaddressmanager.com/extractor/outlook-contacts.html
Best Regards!Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
June 14th, 2011 2:16am
Hiya,
Yes this can be done with Powershell or third party tools as suggested by other replies.
I've answered this question elsewhere - here's a link to the
answer and the original script below, which requires the EWS Managed API
$mail="user@contoso.com"
$outputfile=".\output.csv"
# Set the path to your copy of EWS Managed API
$dllpath = "C:\Program Files\Microsoft\Exchange\Web Services\1.1\Microsoft.Exchange.WebServices.dll"
# Load the Assembly
[void][Reflection.Assembly]::LoadFile($dllpath)
# Create a new Exchange service object
$service = new-object Microsoft.Exchange.WebServices.Data.ExchangeService
# Uncomment to set credentials, otherwise uses logged on user
#$service.credentials = new-object System.Net.NetworkCredential("username", "password", "domain");
# Uncomment (and comment URL below) to Autodiscover using the mail address set above
$service.AutodiscoverUrl($mail)
# Or set it manually
#$service.Url = new-object Uri("https://mail.contoso.com/EWS/Exchange.asmx");
# Specify contacts folder and item count
$view = New-Object Microsoft.Exchange.WebServices.Data.ItemView(10000,0)
# Retrieve the data from the folder
$findResults = $service.FindItems([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Contacts,$view)
# Output header to file
'"FileAs","DisplayName","GivenName","Initials","MiddleName","Surname","NickName","CompanyName","EmailAddress1","EmailAddress2","Address1","Address2","PhoneNumber1","PhoneNumber2","PhoneNumber3","PhoneNumber4","JobTitle"' | Out-File -Encoding ASCII -FilePath $outputfile
# Loop thru results and output line to file.
foreach ($item in $findResults.Items)
{
"""$($item.FileAs)"",""$($item.DisplayName)"",""$($item.GivenName)"",""$($item.Initials)"",""$($item.MiddleName)"",""$($item.Surname)"",""$($item.NickName)"",""$($item.CompanyName)"",""$($item.EmailAddresses[0].Address)"",""$($item.EmailAddresses[1].Address)"",""$($item.PhysicalAddresses[0].Street), $($item.PhysicalAddresses[0].City), $($item.PhysicalAddresses[0].State), $($item.PhysicalAddresses[0].CountryOrRegion), $($item.PhysicalAddresses[0].PostalCode)"",""$($item.PhysicalAddresses[1].Street), $($item.PhysicalAddresses[1].City), $($item.PhysicalAddresses[1].State), $($item.PhysicalAddresses[1].CountryOrRegion), $($item.PhysicalAddresses[1].PostalCode)"",""$($item.PhoneNumbers[0])"",""$($item.PhoneNumbers[1])"",""$($item.PhoneNumbers[2])"",""$($item.PhoneNumbers[3]),$($item.JobTitle)""" | Out-File -Encoding ASCII -FilePath $outputfile -Append
}
Steve
Steve Goodman
Check out my Blog for more Exchange info or find me on
Twitter
Free Windows Admin Tool Kit Click here and download it now
June 14th, 2011 5:20am