23 C
Dubai
Wednesday, December 18, 2024

How to Implement Address Book Policies in Office 365/Exchange 2013/2016 Effectively – Part 3

Read Below Series for Better Understanding –

How to Implement Address Book Policies in Office 365/Exchange 2013/2016 Effectively

How to Implement Address Book Policies in Office 365/Exchange 2013/2016 Effectively – Part 2

How to Implement Address Book Policies in Office 365/Exchange 2013/2016 Effectively – Part 3

Scenario 3: Implementing Address Book Policy (ABP) in Educational Institutions

Things to accomplish –

  • Class A Students won’t see Class B Students
  • Class A Students will see only Class A teachers
  • Class B Students will see only Class B teachers
  • Teachers can view all their Co-teachers,viewing their Class students and the principal
  • Principal(Like CEO) will See , All Teachers and Students.

image

First I would Plan Custom Attributes for the Students – Segregating ClassA students separately

Customattribute1 = ClassAStudent

To apply Custom attribute to these mailboxes –

Get-Mailbox ClassAStudent* | Set-Mailbox -CustomAttribute1 "ClassAStudent"
Get-Mailbox ClassAStudent* | FT Name,Alias,Servername,Customattribute1

image

As similar,Segregating ClassB students separately – Customattribute2 = ClassBStudent

To apply Custom attribute to these mailboxes –

Get-Mailbox ClassBStudent* | Set-Mailbox -CustomAttribute2 "ClassBStudent"
Get-Mailbox ClassBStudent* | FT Name,Alias,Servername,Customattribute2

image

Now will segregate the Teachers

For All the Teachers am going to use – CustomAttribute3 = Teacher

To apply Custom attribute to these mailboxes –

Get-Mailbox *Teacher* | Set-Mailbox -CustomAttribute3 "Teacher"
Get-Mailbox *Teacher* | FT Name,Alias,Servername,Customattribute3

image

As We know already we need to Create 4 things for Every Address Book Policy,

1. Global Address list

2. Address list

3. Rooms list

4. Offline Address book

Now will Create an Address Book Policy for the ClassA students

Going to Set the Criteria whoever has Customattribute1 = ClassAStudent They will be listed in Class A.

1. Global Address list

Creating a Global Address list

Need Exchange Management Shell to create Global Address list ,

Where users with Custom attribute 1 with value ClassAStudent will be showing up

New-GlobalAddressList -Name "ClassA-GAL" -RecipientFilter {(CustomAttribute1 -eq "ClassAStudent")}

image

2. Address list

New-AddressList -Name "ClassA-AL" -RecipientFilter {((RecipientType -eq 'UserMailbox') -or (RecipientType -eq "MailUniversalDistributionGroup") -or (RecipientType -eq "DynamicDistributionGroup")) -and (CustomAttribute1 -eq "ClassAStudent")}

image

3. Rooms list

New-AddressList -Name ClassA-Rooms -RecipientFilter {(Alias -ne $null) -and (CustomAttribute1 -eq "ClassAStudent")-and (RecipientDisplayType -eq 'ConferenceRoomMailbox') -or (RecipientDisplayType -eq 'SyncedConferenceRoomMailbox')}

image

4. Offline Address book

New-OfflineAddressBook -Name "ClassA-OAB" -AddressLists "ClassA-GAL"

Now will Create an Address Book Policy –

New-AddressBookPolicy -Name "ClassA-ABP" -AddressLists "\ClassA-AL" -OfflineAddressBook "\ClassA-OAB" -GlobalAddressList "\ClassA-GAL" -RoomList "\ClassA-Rooms"

image

Applied ClassA-ABP for my ClassAStudents

To apply ABP to these mailboxes –

Get-Mailbox ClassAstudent* | Set-Mailbox -AddressBookPolicy "ClassA-ABP"
Get-Mailbox ClassAStudent* | FT Name,Alias,Servername,Customattribute1,AddressbookPolicy

image

Now My Class A Students will See only Class A Students.

Now Am going to Get the Class A Teacher to Show up for the ClassA Students.

Note : As we created an Address book policy already as whoever has Customattribute1 = ClassAStudent They will be listed in Class A GAL.

Going to ClassA Teacher and am going to set CustomAttribute1 as ClassAStudent

To apply Custom attribute to these mailboxes –

Get-Mailbox ClassATeacher* | Set-Mailbox -CustomAttribute1 ClassAStudent
Get-Mailbox ClassATeacher* | FT Name,Alias,Servername,Customattribute1

image

Going to my ClassAStudent1 Outlook Web Access  you can see their Teachers & co-students alone

image

We need our Principal to be listed in Class A GAL

Note : As we created an Address book policy already as whoever has Customattribute1 = ClassAStudent They will be listed in Class A GAL.

To apply Custom attribute to these mailboxes –

Get-Mailbox Principal | Set-Mailbox -CustomAttribute1 ClassAStudent
Get-Mailbox Principal | FT Name,Alias,Servername,Customattribute1

image

Now you can see the principal listed for the Class A Students

image

Now will Create an Address Book Policy for the ClassB students – Re-doing the same process with ClassB-student

1. Global Address list

2. Address list

3. Rooms list

4. Offline Address book

1. Global Address list

Creating a Global Address list

Need Exchange Management Shell to create Global Address list ,

Where users with Custom attribute 2 with value ClassBStudent will be showing up

New-GlobalAddressList -Name "ClassB-GAL" -RecipientFilter {(CustomAttribute2 -eq "ClassBStudent")}

2. Address list

New-AddressList -Name "ClassB-AL" -RecipientFilter {((RecipientType -eq 'UserMailbox') -or (RecipientType -eq "MailUniversalDistributionGroup") -or (RecipientType -eq "DynamicDistributionGroup")) -and (CustomAttribute2 -eq "ClassBStudent")}

3. Rooms list

New-AddressList -Name ClassB-Rooms -RecipientFilter {(Alias -ne $null) -and (CustomAttribute2 -eq "ClassBStudent")-and (RecipientDisplayType -eq 'ConferenceRoomMailbox') -or (RecipientDisplayType -eq 'SyncedConferenceRoomMailbox')}

4. Offline Address book

New-OfflineAddressBook -Name "ClassB-OAB" -AddressLists "ClassB-GAL"

Now will Create an Address Book Policy –

New-AddressBookPolicy -Name "ClassB-ABP" -AddressLists "\ClassB-AL" -OfflineAddressBook "\ClassB-OAB" -GlobalAddressList "\ClassB-GAL" -RoomList "\ClassB-Rooms"

image

Applying ClassB-ABP for my ClassAStudents

To apply ABP to these mailboxes – Get-Mailbox ClassBstudent* | Set-Mailbox -AddressBookPolicy “ClassB-ABP”

Get-Mailbox ClassBStudent* | FT Name,Alias,Servername,Customattribute2,AddressbookPolicy

image

Now My Class B Students will See only Class B Students.

Now Am going to Get the Class B Teacher to Show up for the ClassB Students.

Note : As we created an Address book policy already as whoever has Customattribute2 = ClassBStudent They will be listed in Class B GAL.

Going to ClassB Teacher and am going to set CustomAttribute2 as ClassBStudent

To apply Custom attribute to these mailboxes –

Get-Mailbox ClassBTeacher* | Set-Mailbox -CustomAttribute2 ClassBStudent
Get-Mailbox ClassBTeacher* | FT Name,Alias,Servername,Customattribute2

image

Going to my ClassBStudent1 Outlook Web Access you can see their Teachers & co-students alone

We need our Principal to be listed in Class B GAL

Note : As we created an Address book policy already as whoever has Customattribute2 = ClassBStudent They will be listed in Class B GAL.

To apply Custom attribute to these mailboxes –

Get-Mailbox Principal | Set-Mailbox -CustomAttribute2 ClassBStudent
Get-Mailbox Principal | FT Name,Alias,Servername,Customattribute2

image

Now you can see the principal listed for the Class B Students

image

Now my Classrooms are Ready

Now will Create an Address Book Policy for the Class A Teachers

 

Now my Class A Teachers has to view all the colleagues (All Teachers)

Now my Class A Teachers has to view only ClassA Students

So setting the value like objects having value 1 or 3 should be listed for Class A Teachers

Customattribute1 = ClassAStudent  or Customattribute3 = Teacher

 

So they will see All the Teachers as well as ClassAStudents alone

1. Global Address list

Creating a Global Address list

Need Exchange Management Shell to create Global Address list ,

Where users with Custom attribute 1 or 3 only will show up

Customattribute1 = ClassAStudent or Customattribute3 = Teacher

New-GlobalAddressList -Name "TeacherA-GAL" -RecipientFilter {(CustomAttribute1 -eq "ClassAStudent") -or (CustomAttribute3 -eq "Teacher")}

image

2. Address list

New-AddressList -Name "TeacherA-AL" -RecipientFilter {((RecipientType -eq 'UserMailbox') -or (RecipientType -eq "MailUniversalDistributionGroup") -or (RecipientType -eq "DynamicDistributionGroup") -and (CustomAttribute1 -eq "ClassAStudent") -or (CustomAttribute3 -eq "Teacher"))}

image

3. Rooms list

New-AddressList -Name "TeacherA-Rooms" -RecipientFilter {(Alias -ne $null) -and (customattribute1 -eq "ClassAStudent") -or (Customattribute3 -eq "Teacher") -and (RecipientDisplayType -eq 'ConferenceRoomMailbox') -or (RecipientDisplayType -eq 'SyncedConferenceRoomMailbox')}

image

4. Offline Address book

New-OfflineAddressBook –Name TeacherA-OAB –Addresslists "TeacherA-GAL"

Now will Create an Address Book Policy –

New-AddressBookPolicy -Name "TeacherA-ABP" -AddressLists "\TeacherA-AL" -OfflineAddressBook "\TeacherA-OAB" -GlobalAddressList "\TeacherA-GAL" -RoomList "\TeacherA-Rooms"

image

Applied TeacherA-ABP to ClassATeachers

To apply ABP to these mailboxes –

Get-Mailbox ClassATeacher* | Set-Mailbox -AddressBookPolicy "TeacherA-ABP"
Get-Mailbox ClassATeacher* | FT Name,Alias,Servername,Customattribute3,AddressbookPolicy

image

Now My TeacherA will See his ClassAStudents and Co-Teachers (With Customattribute3) and the Principal (with CustomAttribute1)

image

I hope you got a Better Understanding now

You can redo the Same process for ClassB Teachers

 

Now Class B Teachers has to view all the colleagues (All Teachers)

Now Class B Teachers has to view only ClassB Students

So setting the custom attribute values 2 and 3 should be listed for Class B Teachers

Customattribute2 = ClassBStudent or Customattribute3 = Teacher

 

So they will see All the Teachers as well as ClassBStudents alone

Copy the Same Commands above and Replace values for custom attributes values and numbers alone.

Principal doesn’t need any Address book policy Cause he doesn’t have any restriction.

To Update all Global address list –

Get-GlobalAddressList | Update-GlobalAddressList

Please find the Process to Remove Address Book Policies –

Get-Mailbox ClassBStudent* | Set-Mailbox -AddressBookPolicy $null

 

Remove-AddressBookPolicy "ClassB-ABP"

 

Remove-OfflineAddressBook "ClassB-OAB"

 

Remove-AddressList ClassB-Rooms

 

remove-AddressList "ClassB-AL"

 

remove-GlobalAddressList "ClassB-GAL"

 

Hope this series will help people to implement address book policies effectively.

How to Implement Address Book Policies in Office 365/Exchange 2013/2016 Effectively

How to Implement Address Book Policies in Office 365/Exchange 2013/2016 Effectively – Part 2

How to Implement Address Book Policies in Office 365/Exchange 2013/2016 Effectively – Part 3

Satheshwaran Manoharan
Satheshwaran Manoharanhttps://www.azure365pro.com
Award-winning Technology Leader with a wealth of experience running large teams and diversified industry exposure in cloud computing. From shipping lines to rolling stocks.In-depth expertise in driving cloud adoption strategies and modernizing systems to cloud native. Specialized in Microsoft Cloud, DevOps, and Microsoft 365 Stack and conducted numerous successful projects worldwide. Also, Acting as a Technical Advisor for various start-ups.

Related Articles

1 COMMENT

  1. Hi,
    Could you suggest how to implement user look-up through Employee id in Outlook? we have no on-prem but Emp id attribute for all users with value available in AzureAD. do i need to update default addressbook with adding Emp id attribute or? please suggest.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

× How can I help you?