New-AddressList -Name 'student List' -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (Department -eq 'student')) -or ((RecipientType -eq 'MailUniversalSecurityGroup') -and (CustomAttribute1 -eq 'student'))} -Container '\'

new-OfflineAddressBook -Name 'Student OAB' -Server 'EX0' -AddressLists '\Student List' -VirtualDirectories 'EX0\OAB (Default Web Site)'

New-GlobalAddressList -Name "Global Student" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (Department -eq 'student')) -or ((RecipientType -eq 'MailUniversalSecurityGroup') -and (CustomAttribute1 -eq 'student'))}

Set-MailboxDatabase -Identity 'Student' -OfflineAddressBook 'Student OAB'

Set-MailboxDatabase -Identity 'Staff' -OfflineAddressBook '\Default Offline Address Book'

Get-MailboxDatabase | fl Name,OfflineAddressBook

update-AddressList -Identity '\Student List'

$b=Get-AddressList 'Student List'
Get-Recipient -RecipientPreviewFilter $b.RecipientFilter

Update-GlobalAddressList "Global Student"

$global=get-globalAddresslist "Global Student"
Get-Recipient -RecipientPreviewFilter $global.RecipientFilter

$global=get-globalAddresslist "Default Global Address List"
Get-Recipient -RecipientPreviewFilter $global.RecipientFilter

Get-OfflineAddressBook | Update-OfflineAddressBook

Update-FileDistributionService -Identity "EX0" -Type OAB

I have to delete the "Student List" and "Student OAB" and recreate them from EMC. Otherwise, the folder C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\OAB will not be populated with the customized OAB.


The correct steps for the customized OAB will be:

In EMC, create the Customized address list "Student List" and the customized OAB "Student OAB".

To update the RecipientFilter, run set-addresslist.

Get-OfflineAddressBook | Update-OfflineAddressBook

Update-FileDistributionService -Identity "EX0" -Type OAB

You will find the "C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\OAB" directory is populated with a new OAB. If "C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\OAB" has only the default OAB, the mailbox users cannot download the assigned OAB "Student OAB".