Monday 27 March 2017

Multi-Tenancy in Microsoft Exchange Server 2013 - 2016

Hi folks after a long time just thought to tell you how to set up the multi-domains in a single Exchange Server 2013,  2016. After googling few days I got a solution. But Why does it require? Suppose you have deployed exchange server with the domain abc.com, your boss may ask you to create a new domain xyz.com because he wants some emails such as admin@xyz.com, support@xyz.com, info@xyz.com etc. to be configured newly. It will also help if your client have requirement of their own domain email id specifically when you are into development. Adding domain suffix or accepted domain is not the solution you want as it does not provide scalability. Multi-Tenancy is what will help sort this out. Remember in Standard edition you can configure and mount up to 5 databases. However, you can use an existing database. I have following preinstalled softwares and prerequisite which I suppose you should consider.

Public DNS Access
Windows Server 2012 R2
Single Active Directory Domain Server
Microsoft Exchange Server 2016 Standard Edition
Exchange Management Shell
Notepad++ ( optional )

To create New Organization Unit
New-ADOrganizationalUnit -Name Hosting

add xyz00001 OU inside Hosting
New-ADOrganizationalUnit -Name xyz00001 -Path "OU=Hosting,DC=abc,DC=com"

To create UPN Suffix
Set-ADForest -Identity abc.com -UPNSuffixes @{add="xyz.com"}

Create accepted domain
New-AcceptedDomain -Name "xyz00001" -DomainName xyz.com -DomainType:Authoritative

Create the Global Address List (GAL) for xyz.com
New-GlobalAddressList -Name "xyz00001 – GAL" -ConditionalCustomAttribute1 "xyz00001" -IncludedRecipients MailboxUsers -RecipientContainer "abc.com/Hosting/xyz00001"

If needed then create All Rooms Address List
New-AddressList -Name "xyz00001 – All Rooms" -RecipientFilter "(CustomAttribute1 -eq 'xyz00001') -and (RecipientDisplayType -eq 'ConferenceRoomMailbox')" -RecipientContainer "abc.com/Hosting/xyz00001"

And time to create All Users Address List
New-AddressList -Name "xyz00001 – All Users" -RecipientFilter "(CustomAttribute1 -eq 'xyz00001') -and (ObjectClass -eq 'User')" -RecipientContainer "abc.com/Hosting/xyz00001"

The All Contacts Address List
New-AddressList -Name "xyz00001 – All Contacts" -RecipientFilter "(CustomAttribute1 -eq 'xyz00001') -and (ObjectClass -eq 'Contact')" -RecipientContainer "abc.com/Hosting/xyz00001"

The All Groups Address List
New-AddressList -Name "xyz00001 – All Groups" -RecipientFilter "(CustomAttribute1 -eq 'xyz00001') -and (ObjectClass -eq 'Group')" -RecipientContainer "abc.com/Hosting/xyz00001"

Now for something quite useful: Offline Address Book
New-OfflineAddressBook -Name "xyz00001" -AddressLists "xyz00001 – GAL"

New Email Address Policy.
New-EmailAddressPolicy -Name "xyz00001 – EAP" -RecipientContainer "abc.com/Hosting/xyz00001" -IncludedRecipients "AllRecipients" -ConditionalCustomAttribute1 "xyz00001" -EnabledEmailAddressTemplates "SMTP:%g.%s@xyz.com","smtp:%m@xyz.com"

Address Book Policy
New-AddressBookPolicy -Name "xyz00001" -AddressLists "xyz00001 – All Users", "xyz00001 – All Contacts", "xyz00001 – All Groups" -GlobalAddressList "xyz00001 – GAL" -OfflineAddressBook "xyz00001" -RoomList "xyz00001 – All Rooms"

This is Optional: create a resource for rooms by creating a Room Mailbox. It is vital that we also set a Custom Attribute for the tenant
New-Mailbox -Name 'xyz00001 Conference Room 1' -Alias 'xyz00001_conf1' -OrganizationalUnit 'abc.com/Hosting/xyz00001' -UserPrincipalName 'confroom1@xyz.com' -SamAccountName 'xyz00001_conf1' -FirstName 'Conference' -LastName 'Room 1' -AddressBookPolicy 'xyz00001' -Room

Set-Mailbox xyz00001_conf1 -CustomAttribute1 'xyz00001'

Set-CalendarProcessing -Identity xyz00001_conf1 -AutomateProcessing AutoAccept -DeleteComments $true -AddOrganizerToSubject $true -AllowConflicts $false

New-Mailbox -Name 'xyz Support' -Alias 'xyz00001_Support' -OrganizationalUnit 'abc.com/Hosting/xyz00001' -UserPrincipalName 'support@xyz.com' -SamAccountName 'xyz00001_Supp' -FirstName 'Support' -ResetPasswordOnNextLogon $false -AddressBookPolicy 'xyz00001' -Database "LOCOCHECKDB01"

Set-Mailbox support@xyz.com -CustomAttribute1 "xyz00001"

Add/update the quota on a mailbox.
Set-Mailbox -Identity "mike@xyz.com" -IssueWarningQuota 4.5gb -ProhibitSendQuota 4.9gb -ProhibitSendReceiveQuota 5gb -UseDatabaseQuotaDefaults $false

After configuring all commands successfully, we will have to create SRV record in Public DNS for domain that is xyz.com here. I have done it as below.

Hope this will help!


No comments:

Post a Comment