Hello everyone
I have a problem with searching for the Exchange User object based on the email address of the person, instead of full name.
The idea behind the script is to go through a list of email addresses in a csv file and output the full names, addresses, job titles along with the email addresses to a different csv file. Here's how I try to access the user object.
Code:
The results of the above code are wrong (shows a wrong user), however they are fine if I try the code below, i.e. with a name instead of email address.
At one point I have done it just for my local Contact List, where I was able to use something like that, however I need it for the global address list.
Thanks in advance for help to find specific users on the basis of their email addresses!
I have a problem with searching for the Exchange User object based on the email address of the person, instead of full name.
The idea behind the script is to go through a list of email addresses in a csv file and output the full names, addresses, job titles along with the email addresses to a different csv file. Here's how I try to access the user object.
Code:
Code:
set appOutlook = CreateObject("Outlook.Application")
set objNameSpace = appOutlook.GetNameSpace("MAPI")
set objAddressLists = objNameSpace.AddressLists("Global Address List")
set objAddressEntry = objAddressLists.AddressEntries("user@mydomain.com").GetExchangeUser()
strFullName = objAddressEntry.Name
strJobTitle = objAddressEntry.JobTitle
strBusinessAddress = objAddressEntry.PrimarySmtpAddress
msgBox strFullName & strJobTitle & strBusinessAddress
Code:
set objAddressEntry = objAddressLists.AddressEntries("John Doe").GetExchangeUser()
At one point I have done it just for my local Contact List, where I was able to use something like that, however I need it for the global address list.
Code:
Set objContact = objContacts.Items.Find("[IMAddress] = ""user@mydomain.com""")
Thanks in advance for help to find specific users on the basis of their email addresses!