By default in Office 365, when a new Public Folder is created it gets assigned an email address as follows:
<publicfoldername>@<companyURL>.onmicrosoft.com


So what do we do if we want the default reply address to look like the rest of our company emails?
<publicfoldername>@<companyURL>.com


This requires us to connect to the Office 365 server and make a change to Email Address Policy. To do this we must connect using Powershell.

Note: You should have already created the public folder at this point

                

Step 1: Connecting to Office 365 with Powershell

                            Expand                          

This requires us to connect to the Office 365 server and make a change to Email Address Policy. To do this we must run the following commands.
Note: You should have already created the public folder at this point


Open Powershell.

PS C:>$UserCredential = Get-Credential

This will prompt for the admin accounts login details.
Eg: admin@<companyURL>.onmicrosoft.com (Unless another user has been assigned admin)

          

Step 2: Create a Session

                          

PS C:> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic –AllowRedirection

PS C:> Import-PSSession $Session

We should now have established a connection to the Exchange server. Now we need to run the command that will disable the Email Address Policy.

          

Step 3: Disable Email Address Policy

                          


PS C:> Set-MailPublicFolder -Identity "\<foldername>" -EmailAddressPolicyEnabled $False

Note: Don’t forget to change the folder name to the public folder in which you are removing the Email Address Policy

          

Step 4: Kill Session with Server

                          

Once you have disabled the policy it is important to kill the session with the Exchange server. To this we run the following command.

PS C:> Remove-PSSession $Session

         

Step 5: Adding a new reply address in Exchange Control Panel (ECP)

                            Expand                          

Login into Office 365 and go to Outlook settings.
Go to public folders > public folders

Click on a public folder (next to the link, not on the link) to select it then click the "Edit" link above the Public Folders list.

          

Step 6: Make this the Reply Address

                            Expand                          

Now because of the Powershell command we run earlier we can tick the option to make this our reply address.