Hybrid Management - Part 10 - Creating Office 365 Room and Equipment Mailboxes via PowerShell

Welcome to my tutorials on Hybrid Exchange - Office 365 Administration -

All Hybrid Administration Tutorials
- How to configure your desktop PC for Hybrid Exchange - Office 365 - Azure Administration - Link
- How to connect to Hybrid Exchange - Office 365 - Azure AD and Local AD via PowerShell - Link
- Hybrid Management - Part 01 - Creating local User mailboxes - Link
- Hybrid Management - Part 02 - Creating local Exchange Shared Mailboxes - Link
- Hybrid Management - Part 03 - Creating local Exchange Room and Equipment Mailboxes - Link
- Hybrid Management - Part 04 - Configure the Hybrid Connection Wizard - Link
- Hybrid Management - Part 05 - Individual mailbox moves via the EAC - Link
- Hybrid Management - Part 06 - Bulk mailbox moves via the EAC - Link
- Hybrid Management - Part 07 - Moving bulk mailboxes with PowerShell - Link
- Hybrid Management - Part 08 - Creating Office 365 User Mailboxes via PowerShell - Link
- Hybrid Management - Part 09 - Creating Office 365 Shared Mailboxes via PowerShell - Link
- Hybrid Management - Part 10 - Creating Office 365 Room and Equipment Mailboxes via PowerShell - Link

---------------------------------------------------------------------------------------------------

Hybrid Management - Part 10 - Creating Office 365 Room and Equipment Mailboxes via PowerShell

This tutorial will walk you through creating Office 365 Room and Equipment Mailboxes.
The script is available as part of my Hybrid Office 365 Administration Pack - Download Link

It is critical that you follow the pre-requisites below as my Hybrid connection script is needed to run these Hybrid Management scripts successfully.

----------------------------------------------------------------------------------------------------

Pre-requisites

Preparation Guides
- Follow the guides below to ensure your PC should is configured for Hybrid Administration - 
How to configure your desktop PC for Hybrid Exchange - Office 365 - Azure Administration - Link
How to connect to Hybrid Exchange - Office 365 - Azure AD and Local AD via PowerShell - Link

Downloads -
My Hybrid Office 365 Administration Pack - Download Link
My Hybrid Connection Script - Download Link

----------------------------------------------------------------------------------------------------

Introduction -
At some point in your Hybrid administration, you will move on from creating local Exchange mailboxes that are later moved to Office 365, to now creating mailboxes directly in Office 365.
The PowerShell process for this is to create a RemoteMailbox. This allows the full Hybrid experience for newly created Office 365 mailboxes.

The basic process for creating all the various types of Office 365 mailboxes is very similar, apart from a few small differences (different cmdlets are used). In fact, if you compare the the powershell script cmdlets used in the creation of these objects, you will see the cmdlet changes.

All spreadsheets for all Office 365 mailbox creations have the three same permissions columns -
- Full Access
- Send As
- Send on Behalf.




Only the Rooms and Equipment spreadsheet has the Booking Delegate and Resource Capacity columns as well as the Full Access, Send As and Send on Behalf.
Note that the Office column is in all spreadsheets, but is displayed as the Location field in any Room and Equipment Exchange objects




This is also the same for both Local Exchange and Office 365 mailboxes.

---------------------------------------------------------------------------------------------

Preparation for creating Office 365 Resource mailboxes via PowerShell - (Remote Mailboxes)

To start creating Office 365 Room and Equipment Mailboxes, ensure you have already downloaded the following scripts and csv folders mentioned earlier in the pre-requisites section.
--- Hybrid Connection Script - Download Link
--- Hybrid Office 365 Administration Pack - Download Link

Extract the folders in the Hybrid Office 365 Administration Pack zip file to the folder of your choice. Copy the appropriate ps1 and csv files to the root of c:\scripts.




------------------------------------------------------------------------------------------

Office 365 Room and Equipment Mailbox Creation -

Editing the csv file with your Room and Equipment Mailbox details
*** Note that the process for editing the csv files is the same for both Rooms and Equipment ***
For simplification, we will review the process for the Room creation in the following steps.
To create Equipment mailboxes, the process is exactly the same, only the script is different.

Creating room mailboxes -

Edit the RemoteRoomMailboxes.csv with your data.
See the example below for guidance -

*** Notes for editing the RemoteSharedMailboxes.csv file ***
The following fields MUST contain data to create a valid mailbox -
- Name                         ( This becomes the Display Name )
- UPN                           ( This becomes the login ID which matches the email address )
- Alias                          ( This must match the start of the email address / UPN)
- OU                             ( This is the Organizational Unit of where you are creating the user)


Although that is the minimum that is needed to actually create a mailbox, you would in normal practice use FirstName and LastName for ease of management.

Things to be aware of when updating the spreadsheet for Room and Equipment mailboxes.
Name
- This becomes the Display Name of the user's mailbox

UPN
- This becomes the login ID which needs to match the Primary SMTP address

Alias
- Ensure this matches the start for the email address / UPN

OU
- Ensure the Organisational Unit is correct

CustomAttribute1
- This can be used to simplify Enterprise Management - Link

SendAs
- Enter the UPN of the user (or email address of group) that needs Send As permission to the mailbox
- Ensure this user exists before running the script

FullAccess
- Enter the UPN of the user (or email address of group) that needs Full Access permission to the mailbox
- Ensure this user or group exists before running the script

SendOnBehalf
- Enter the UPN of the user (or email address of group) that needs SendOnBehalf permission to the mailbox
- Ensure this user or group exists before running the script

Manager
- Enter the Alias of the Manager (this is usually the UPN without the domain name.
- - Example
- UPN / Email address of the Manager - user.101@teamterry365.com
- Alias of the Manager - user.101
- Ensure this user or group exists before running the script

Country
- Note that you must use the two character code for the Country - Link
- - Example -
- AU - Australia
- US - United States

--- Special fields for Rooms and Equipment Mailboxes ---

Booking Delegate
- Enter the UPN of the user (or email address of group) that will be the Booking Delegate for the Room or Equipment
Note - If you leave the Booking Delegate field empty, the room or equipment mailbox will be set to AutoAccept 

Resource Capacity -
- Enter the capacity of the Room or Equipment

Office
This is the Location of the Room or Equipment


The other fields are plain text fields which are self explanatory
- City
- Company
- Department
- HomePhone
- MobilePhone
- OfficePhone
- StreetAddress
- State
- PostalCode
- Country
- HomePage
- Fax

Once you have finished creating your csv file, save as C:\Scripts\RemoteRoomMailboxes.csv

---------------------------------------------------------------------------------------------------

Running the scripts for Office 365 Shared Mailbox creation

Connect to your local Exchange, AD and Azure AD Connect server using this tutorial -
- How to connect to Hybrid Exchange - Office 365 - Azure AD and Local AD via PowerShell - Link

Run the script -
Open PowerShell ISE and connect using my Hybrid Connection script - (see above).
Open the folder - and drag the script - New-RemoteRoomMailbox-v-x to PowerShell ISE









Once you have updated your csv, you can simply run the script by clicking the Play arrow.

When the script runs, you will see that it has created the mailboxes.
There will be a delay while the accounts are synchronised to Office 365 by Azure AD Connect.





After Azure AD Connect runs, there is a five minute pause to ensure the accounts are fully provisioned.

After this delay, the script will continue and apply delegate permissions.

The screen will display the delegate permission changes.












The script will then advise that the Remote Room Mailboxes have been created and synched to Office 365.



Please note that I have not built error checking into my script, so it is important to confirm the mailboxes have created successfully.

-----------------------------------------------------------------------------------------------------

Confirming creation of Office 365 Room mailboxes
Log into the Office 365 - Exchange EAC and confirm the creation of the Room mailboxes.










You can also confirm the successful setting of delegated permissions by checking the mailboxes.


Now confirm the Booking Delegate (if selected)
- Note the setting - Select delegates who can accept or decline booking requests

Now confirm the room or equipment is set to AutoAccept (if no Booking Delegate is assigned).
- Note the setting - Accept or decline booking requests automatically.
-- Also note, that a delegate appears because that user has Send On Behalf permission.













Screenshot below shows a Room created with no Booking Delegate



----------------------------------------------------------------------------------------------------------

Creating Equipment Mailboxes -

Follow the exact same process for creating Equipment mailboxes.
Equipment mailboxes will show under resources in the Office 365 - Exchange EAC


----------------------------------------------------------------------------------------------------------

Congratulations -
You have successfully created Office 365 Room and Equipment Mailboxes via PowerShell

------------------------------------------------------------------------------------------------------------

No comments:

Post a comment