How to set up per database OAL and OAB in Exchange 2016

Úvodní stránka Fóra Microsoft Windows How to set up per database OAL and OAB in Exchange 2016

  • Toto téma obsahuje celkem 1 odpověď. Do diskuze (1 diskutující) se naposledy zapojil uživatel patok a poslední změna proběhla před 3 roky a 10 měsíci.
Aktuálně jsou na stránce zobrazeny 2 příspěvky - 1. až 2. (celkem z 2)
  • Autor
    Příspěvky
  • #284833
    patok
    Správce

    I want to share with you few commands which I’ve recently used to create diferent OAL (Outlook Adress Lists) and OAB (Outlook Address Books) for separate databases in Exchange 2016. First thing – it’s imposible to do it only with EMC (at least with Exchange 2016 rollup 2) – you have to use EMS. In this example I use two mailbox databases called MAILBOXDB_01 and MAILBOXDB_02, but you can use as much databases as you need. That’s it…

    There are the commands:

    
    New-AddressList -Name "All Rooms (MAILBOXDB_01)" -RecipientFilter {(Alias -ne $null) -and (Database -eq "CN=MAILBOXDB_01,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com") -and (((RecipientDisplayType -eq 'ConferenceRoomMailbox') -or (RecipientDisplayType -eq 'SyncedConferenceRoomMailbox')))}
    New-AddressList -Name "All Rooms (MAILBOXDB_02)" -RecipientFilter {(Alias -ne $null) -and (Database -eq "CN=MAILBOXDB_02,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com") -and (((RecipientDisplayType -eq 'ConferenceRoomMailbox') -or (RecipientDisplayType -eq 'SyncedConferenceRoomMailbox')))}
    
    New-AddressList -Name "All Users (MAILBOXDB_01)" -RecipientFilter {(Alias -ne $null) -and (Database -eq "CN=MAILBOXDB_01,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com") -and (((((((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (-not(Database -ne $null)) -and (-not(ServerLegacyDN -ne $null)))) -or (((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (((Database -ne $null) -or (ServerLegacyDN -ne $null))))))) -and (-not(RecipientTypeDetailsValue -eq 'GroupMailbox'))))}
    New-AddressList -Name "All Users (MAILBOXDB_02)" -RecipientFilter {(Alias -ne $null) -and (Database -eq "CN=MAILBOXDB_02,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com") -and (((((((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (-not(Database -ne $null)) -and (-not(ServerLegacyDN -ne $null)))) -or (((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (((Database -ne $null) -or (ServerLegacyDN -ne $null))))))) -and (-not(RecipientTypeDetailsValue -eq 'GroupMailbox'))))}
    
    New-AddressList -Name "Public Folders (MAILBOXDB_01)" -RecipientFilter {(Alias -ne $null) -and (Database -eq "CN=MAILBOXDB_01,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com") -and (ObjectCategory -like 'publicFolder')}
    New-AddressList -Name "Public Folders (MAILBOXDB_02)" -RecipientFilter {(Alias -ne $null) -and (Database -eq "CN=MAILBOXDB_02,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com") -and (ObjectCategory -like 'publicFolder')}
    
    New-AddressList -Name "All Contacts (MAILBOXDB_01)" -RecipientFilter {(Alias -ne $null) -and (RecipientContainer -eq "OU=MAILBOXDB_01,OU=Contacts,OU=PRAGUEMEDICAL,DC=example,DC=com") -and (((ObjectCategory -like 'person') -and (ObjectClass -eq 'contact')))}
    New-AddressList -Name "All Contacts (MAILBOXDB_02)" -RecipientFilter {(Alias -ne $null) -and (RecipientContainer -eq "OU=MAILBOXDB_02,OU=Contacts,OU=PRAGUEMEDICAL,DC=example,DC=com") -and (((ObjectCategory -like 'person') -and (ObjectClass -eq 'contact')))}
    
    New-GlobalAddressList -Name "Global Address List (MAILBOXDB_01)" -RecipientFilter {(Alias -ne $null) -and (Database -eq "CN=MAILBOXDB_01,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com") -and (((ObjectClass -eq 'user') -or (ObjectClass -eq 'contact') -or (ObjectClass -eq 'msExchSystemMailbox') -or (ObjectClass -eq 'msExchDynamicDistributionList') -or (ObjectClass -eq 'group') -or (ObjectClass -eq 'publicFolder')))}
    New-GlobalAddressList -Name "Global Address List (MAILBOXDB_02)" -RecipientFilter {(Alias -ne $null) -and (Database -eq "CN=MAILBOXDB_02,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com") -and (((ObjectClass -eq 'user') -or (ObjectClass -eq 'contact') -or (ObjectClass -eq 'msExchSystemMailbox') -or (ObjectClass -eq 'msExchDynamicDistributionList') -or (ObjectClass -eq 'group') -or (ObjectClass -eq 'publicFolder')))}
    
    New-OfflineAddressBook -Name "Offline Address List (MAILBOXDB_01)" -AddressLists "Global Address List (MAILBOXDB_01)"
    New-OfflineAddressBook -Name "Offline Address List (MAILBOXDB_02)" -AddressLists "Global Address List (MAILBOXDB_02)"
    
    New-AddressBookPolicy -Name "AddressBook Policy (MAILBOXDB_01)" -AddressLists "All Users (MAILBOXDB_01)","All Contacts (MAILBOXDB_01)" -OfflineAddressBook "\Offline Address List (MAILBOXDB_01)" -GlobalAddressList "\Global Address List (MAILBOXDB_01)" -RoomList "\All Rooms (MAILBOXDB_01)"
    New-AddressBookPolicy -Name "AddressBook Policy (MAILBOXDB_02)" -AddressLists "All Users (MAILBOXDB_02)","All Contacts (MAILBOXDB_02)" -OfflineAddressBook "\Offline Address List (MAILBOXDB_02)" -GlobalAddressList "\Global Address List (MAILBOXDB_02)" -RoomList "\All Rooms (MAILBOXDB_02)"
    
    Get-Mailbox -resultsize unlimited | where {$_.Database -eq "MAILBOXDB_01"} | Set-Mailbox -AddressBookPolicy "AddressBook Policy (MAILBOXDB_01)"
    Get-Mailbox -resultsize unlimited | where {$_.Database -eq "MAILBOXDB_02"} | Set-Mailbox -AddressBookPolicy "AddressBook Policy (MAILBOXDB_02)"
    
    • Téma bylo upraveno před 3 roky a 11 měsíci uživatelem patok.
    #285878
    patok
    Správce

    UPDATE:

    I did some changes, because I’d forgot to involve „Public Folders“, and „Distribution Lists“. This time I use not only two, but three separated mail databases, bud grouping two of them together and one is completely separated:

    
    New-AddressList -Name "All Rooms (DOM1+DOM2)" -RecipientFilter {(Alias -ne $null) -and ((Database -eq "CN=DOM1,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com") -or (Database -eq "CN=DOM2,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com")) -and (((RecipientDisplayType -eq 'ConferenceRoomMailbox') -or (RecipientDisplayType -eq 'SyncedConferenceRoomMailbox')))}
    New-AddressList -Name "All Rooms (DOM3)" -RecipientFilter {(Alias -ne $null) -and (Database -eq "CN=DOM3,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com") -and (((RecipientDisplayType -eq 'ConferenceRoomMailbox') -or (RecipientDisplayType -eq 'SyncedConferenceRoomMailbox')))}
    
    New-AddressList -Name "All Users (DOM1+DOM2)" -RecipientFilter {(Alias -ne $null) -and ((Database -eq "CN=DOM1,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com") -or (Database -eq "CN=DOM2,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com")) -and (((((((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (-not(Database -ne $null)) -and (-not(ServerLegacyDN -ne $null)))) -or (((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (((Database -ne $null) -or (ServerLegacyDN -ne $null))))))) -and (-not(RecipientTypeDetailsValue -eq 'GroupMailbox'))))}
    New-AddressList -Name "All Users (DOM3)" -RecipientFilter {(Alias -ne $null) -and (Database -eq "CN=DOM3,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com") -and (((((((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (-not(Database -ne $null)) -and (-not(ServerLegacyDN -ne $null)))) -or (((ObjectCategory -like 'person') -and (ObjectClass -eq 'user') -and (((Database -ne $null) -or (ServerLegacyDN -ne $null))))))) -and (-not(RecipientTypeDetailsValue -eq 'GroupMailbox'))))}
    
    New-AddressList -Name "Public Folders (DOM1+DOM2)" -RecipientFilter {(Alias -ne $null) -and ((Database -eq "CN=DOM1,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com") -or (Database -eq "CN=DOM2,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com")) -and (ObjectCategory -like 'publicFolder')}
    New-AddressList -Name "Public Folders (DOM3)" -RecipientFilter {(Alias -ne $null) -and (Database -eq "CN=DOM3,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com") -and (ObjectCategory -like 'publicFolder')}
    
    New-AddressList -Name "All Contacts (DOM1+DOM2)" -RecipientFilter {(Alias -ne $null) -and (RecipientContainer -eq "OU=DOM1\+DOM2,OU=Contacts,OU=COMPANY,DC=example,DC=com") -and (((ObjectCategory -like 'person') -and (ObjectClass -eq 'contact')))}
    New-AddressList -Name "All Contacts (DOM3)" -RecipientFilter {(Alias -ne $null) -and (RecipientContainer -eq "OU=DOM3,OU=Contacts,OU=COMPANY,DC=example,DC=com") -and (((ObjectCategory -like 'person') -and (ObjectClass -eq 'contact')))}
    
    # tried this for distribution lists, but to solve it as quick as possible I decided to create it in EMC; this doesn't work, but it can be useful for notion:
    #New-AddressList -Name "All Distribution Lists (DOM1)" -RecipientFilter {(Alias -ne $null) -and (ObjectCategory -like 'group') -and (RecipientContainer -eq "OU=DOM1,OU=Groups,OU=COMPANY,DC=example,DC=com")}
    #New-AddressList -Name "All Distribution Lists (DOM1)" -Container "example.com/COMPANY/Groups/DOM1" -RecipientFilter {(Alias -ne $null) -and (ObjectCategory -like 'group')}
    
    New-GlobalAddressList -Name "Global Address List (DOM1+DOM2)" -RecipientFilter {(Alias -ne $null) -and ((Database -eq "CN=DOM1,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com") -or (Database -eq "CN=DOM2,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com")) -and (((ObjectClass -eq 'user') -or (ObjectClass -eq 'contact') -or (ObjectClass -eq 'msExchSystemMailbox') -or (ObjectClass -eq 'msExchDynamicDistributionList') -or (ObjectClass -eq 'group') -or (ObjectClass -eq 'publicFolder')))}
    New-GlobalAddressList -Name "Global Address List (DOM3)" -RecipientFilter {(Alias -ne $null) -and (Database -eq "CN=DOM3,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=example,DC=com") -and (((ObjectClass -eq 'user') -or (ObjectClass -eq 'contact') -or (ObjectClass -eq 'msExchSystemMailbox') -or (ObjectClass -eq 'msExchDynamicDistributionList') -or (ObjectClass -eq 'group') -or (ObjectClass -eq 'publicFolder')))}
    
    New-OfflineAddressBook -Name "Offline Address Book (DOM1+DOM2)" -AddressLists "Global Address List (DOM1+DOM2)"
    New-OfflineAddressBook -Name "Offline Address Book (DOM3)" -AddressLists "Global Address List (DOM3)"
    
    New-AddressBookPolicy -Name "AddressBook Policy (DOM1+DOM2)" -AddressLists "\All Users (DOM1+DOM2)","\All Contacts (DOM1+DOM2)","\All Distribution Lists (DOM1+DOM2)","\Public Folders (DOM1+DOM2)" -OfflineAddressBook "\Offline Address Book (DOM1+DOM2)" -GlobalAddressList "\Global Address List (DOM1+DOM2)" -RoomList "\All Rooms (DOM1+DOM2)"
    New-AddressBookPolicy -Name "AddressBook Policy (DOM3)" -AddressLists "\All Users (DOM3)","\All Contacts (DOM3)","\All Distribution Lists (DOM3)","\Public Folders (DOM3)" -OfflineAddressBook "\Offline Address Book (DOM3)" -GlobalAddressList "\Global Address List (DOM3)" -RoomList "\All Rooms (DOM3)"
    
    Get-Mailbox -resultsize unlimited | where {$_.Database -eq "DOM1"} | Set-Mailbox -AddressBookPolicy "AddressBook Policy (DOM1+DOM2)"
    Get-Mailbox -resultsize unlimited | where {$_.Database -eq "DOM2"} | Set-Mailbox -AddressBookPolicy "AddressBook Policy (DOM1+DOM2)"
    Get-Mailbox -resultsize unlimited | where {$_.Database -eq "DOM3"} | Set-Mailbox -AddressBookPolicy "AddressBook Policy (DOM3)"
    
Aktuálně jsou na stránce zobrazeny 2 příspěvky - 1. až 2. (celkem z 2)
  • Pro reakci na toto téma se musíte přihlásit.