[How to] Import AD users on Exchange server
As of I remember, last time when we were on the blog of Exchange. We were up to the configuration of Virtual Directories for Exchange server. And we have already done work with import of bulk users on our Active Directory, Importing user on Active Directory will not create an Exchange mailbox on the Exchange server. Hence, we need to effort differently to create mailbox for use users on Active Directory. If it was Exchange Server 2010, we could have done it on GUI easily. But with the Exchange 2013 and Exchange 2016, those facilities are not available. Therefore, we need to trick to import those AD users on Exchange server to create mailboxes.
In Exchange 2013 and Exchange 2016, if we need to create a multiple mailbox we need to use PowerShell cmdlet to import those users form the Active Directory. On this blog, I am mentioning two methods to import Active Directory users on the blog.
To import all the users those are existing on the Active Directory, we can import using the below cmdlet.
C:\Users\Administrator>Get-User -RecipientTypeDetails User -Filter { UserPrincipalName -ne $Null } | Enable-Mailbox
There might be condition that I would like to import only few users on the Exchange Mailbox. At that condition, we can collect those user on the specific OU and import them with the boundary name of that OU. Here ‘Employees’ is my OU for which i want to Add users.
Import-module activedirectory $users = Get-ADUser -LDAPfilter '(name=*)' -searchBase 'OU=test,OU=pdhewaju,DC=pdhewaju,DC=com,DC=np' foreach($user in $users) { Enable-Mailbox -Identity $user.SamAccountName }
I hope this will make too easy to import multiple user Active Directory to Exchange Server.