Posts

Showing posts from September, 2016

Getting Exchange Server Recipients from Active Directory

I run into a strange issue today where I had to get a list of all the users that had a mailbox without having access to any Exchange servers. It was crucial that the list did not contain any MailUsers or MailContacts since those objects are managed using Microsoft Identity Manager (MIM).

Since I could not access any Exchange servers, the use of the Get-Mailbox cmdlet was out of the question. I had to go to the source, the Active Directory. Exchange depends heavily on Active Directory and that was the place I would find the information I needed.

So, I fired up Powershell ISE and loaded the activedirectory module. In order to filter the objects, we are going to use the msExchRecipientTypeDetails attribute. The values of this attribute represent the different Exchange Recipient Types. You can find more details about the values here: https://blogs.technet.microsoft.com/dkegg/2014/05/09/msexchrecipienttypedetails/

Since I only want the users with a mailbox, I am going to use the Get-ADUser…