Author Archives: Kelsey Epps

Forcing Retention Policy to Run – Office 365 (Exchange Online)

Recently I have been tasked with setting up a pretty complete set of Retention Policies. Rather than waiting for the automatic MRM process to run on its own schedule, we can force it to run using PowerShell.

The KB from Microsoft for the PowerShell command is: https://technet.microsoft.com/en-us/library/aa998864(v=exchg.160).aspx

 

  1. Connect to Exchange Online with PowerShell
  2. Run the following command
    1. Start-ManagedFolderAssistant -Identity “user@domain.com”
    2. Make sure to update “user@domain.com” to the user you want to trigger MRM on.

This will trigger MRM to start to process the mailbox specified.

Where is my data, Office 365/Azure?

Here is a quick and easy way to find the high-level information on where your data is stored. As we know, Microsoft has multiple data centers around the globe. Microsoft will use the country specified, when opening the tenant, as a location for the data. In saying that there are some of the Office 365 services that are not offered in all Microsoft data centers, so you will have to piece together your data location. Exchange, SharePoint and Skype can we seen from the Office 365 Admin center.

Open the Office 365 Admin Center

Expand Settings

Expand Organization Profile

Scroll down to data location

To view the specifics about what Microsoft services are available in your specified region, please use this site.

Where is my data (Microsoft Site)

Office 365 (Exchange Online) Archive Mailbox Size Reporting (PowerShell)

Here are some quick PowerShell commands to report on the size of the Office 365 (Exchange Online) Archive Mailbox size.

Microsoft has this information published in the following KB: https://msdn.microsoft.com/en-us/library/gg576861(v=exchsrvcs.149).aspx

Open a connection to Exchange Online with PowerShell.

The command below will get the get the display name, total archive size and total item count for a specified user:

Get-MailboxStatistics <Identity> -ArchiveFormat-List DisplayName,TotalItemSize,ItemCount

The command below will get the get the display name, total archive size and total item count for all users and then out put the results to a CSV:

Get-Mailbox -Archive -ResultSize Unlimited Get-MailboxStatistics -Archive Select DisplayName,@{name=“TotalItemSize (MB)”;expression={[math]::Round((($_.TotalItemSize.Value.ToString()).Split(“(“)[1].Split(” “)[0].Replace(“,”,“”)/1MB),2)}},ItemCountSort “TotalItemSize (MB)” -Descending Export-Csv C:\Path\FileName.csv” -NoTypeInformation

Office 365 (Exchange Online) Archive Mailbox Size Reporting (Portal)

To view the size of an Office 365 (Exchange Online) Archive mailbox in the Office 365 portal, follow the instructions below:

If you are looking on how to complete this in PowerShell, please use this article.

Open the Office 365 Admin Portal

Open the Exchange Admin Center

Click Recipients

Click Mailboxes

Select the User Mailbox

Click View Detail in the In-Place Archive

Details are displayed

Un-Encrypted PST Import (Network Upload) to Office 365

This is a complete step-by-step for using the Office 365 Import Service to upload an un-encrypted PST File to Office 365.

Please review the Microsoft documentation for this process for updates or changes to this process.

https://technet.microsoft.com/en-us/library/mt644809.aspx

Pre-Requisites

Mailbox Import Export Role – In order to perform the import, the account doing the import needs to be assigned the Mailbox Import Export role. This is easily accomplished by adding the role to the Organization Management role group (as seen in the screen shot). Alternatively, you can create a new role group and assign your account permissions.

Open Exchange Admin Center

(1) Click Permissions

(2) Click Admin Roles

(3) Double Click Organization Management

(4) Click + Roles

(5) Select Mailbox Import Export

(6) Click Add ->

(7) Click OK

(8) Click Save

PST File Share – The PST file(s) that are being imported (because you can import more than one at a time), need to be stored on a network file share, or a file share on your local PC. Note the syntax in the later steps with AZCopy.exe.

Storage Key and Upload URL – During the process below, you are given a storage key and an upload URL. Keep these secure and treat the just like a password. If they fall into the wrong hands, anyone can upload to your tenant.

 

Step-by-Step Process for an Un-Encrypted PST Import (Network Upload) to Office 365

 

  • Download Network Upload Tool (AzCopy.exe)

In order to upload PST files to Microsoft, you must download and install the AzCopy.exe tool. Follow the process below to download and install the tool.

Navigate to https://protection.office.com

Sign in with a Global Admin account for your organization

(1) Click Data Management

(2) Click Import

(3) Click Go to the Import Service

(4) Click

(5) Click Upload Files Over the Network

On the popup page, click Download Tool (Azure AzCopy tool)

Click Run

Click Next

Agree to the EULA

Click Next

Accept the default install location

Click Next

Click Install

Click Yes

Click Finish

  • Storage Key and Upload URL

Before we can use the AzCopy tool to upload the PST file(s) to Office 365, we need to get the upload secure key and the URL. Please use the steps below to get the key and URL specific to your tenant.

Open the Import Data to Office 365 page that we had open the the prvious step

Click the icon

***NOTE*** This is a secure key and URL. Treat this like a password and make sure that it’s kept secure.

Click Copy Key (note this this process can take up to 5 minutes to complete)

Click Show URL for PST Files

Copy the key and URL for use in the next step

  • Upload the PST File(s) to Office 365

Now that we have the AzCopy tool downloaded and installed and we have the secure key and URL, can now upload the PST file(s) to Office 365. Follow the steps below to upload the PST file(s) to Office 365.

Open a command prompt as an admin (on the machine where you installed AzCopy)

Open the directory where you installed AzCopy

Run the following command to start the PST File(s) upload

AzCopy.exe /Source:\\SERVER01\PSTshare /Dest:<URL COPIED FROM STEP ABOVE>/SERVER01/PSTshare/ /Destkey:<SECURE KEY COPIED FROM STEP ABOVE> /S /V:C:\PSTshare\Uploadlog.log

\\SERVER01\PSTshare This denotes the share in which your PST File(s) are placed. If there are multiple PST Files in this location, AzCopy will upload them all.

<URL COPIED FROM STEP ABOVE> This denotes the URL that we got from Office 365 in the step above.

<SECURE KEY COPIED FROM STEP ABOVE> This denotes the secure key that we got from Office 365 in the step above.

C:\PSTshare\Uploadlog.log This denotes a location on the local machine where the verbose log file can be written

If you need additional help or need further explanation on the command above, please use this Microsoft site. https://technet.microsoft.com/en-us/library/mt644809.aspx

 

  • Create the PST Mapping File

Now that the PST File(s) are uploaded to Office 365, we need to create a CSV file that will map the PST file to the mailbox in Office 365. Follow the steps below to create the CSV file.

Download the PST Mapping Template File from Microsoft

Complete the CSV file with your specific information, filling in as many lines as needed. One line per PST file uploaded.

***Note **** If you need additional help or need further explanation on the PST Mapping File, please use this Microsoft site.

Save the PST Mapping File

 

  • Create the Office 365 Import Job

Now that we have the data uploaded and the PST mapping file saved, we can create the import job in Office 365 that will take the mapping file and import the PST files to the mailboxes specified. Follow the steps below to complete the process.

Navigate to https://protection.office.com

Sign in with a Global Admin account for your organization

(1) Click Data Management

(2) Click Import

(3) Click Go to the Import Service

(4) Click

(5) Click Upload Files Over the Network

(6) Check * I’m done uploading my files

(7) Check * I have access to the mapping file

(8) Click Next

(9) Enter a Job Name

(10) Click Next

(11) Click + to Add the Mapping File

(12) Validate the Mapping File (Under 100 rows)

(13) Agree to the terms and conditions

(14) Click Finish

(15) Click Closed

The import will now start. You can check the status of the import by going to the Office 365 Admin Center and opening the Import tab. Use the refresh button to get the updated status.

Monitor the status column for completion or error. My upload below completed with skipped items. Clicking on the job and the selecting View Details will allow you to troubleshoot the status message. With my example below, I had one corrupted mail item and this was discovered with a detailed log provided with the upload.

 

Thanks for visiting and reading my posts. I am always looking for more ideas. Please comment or email me with what you would like to see.

Kelsey Epps Office365 MVP

Email Me Follow me on Twitter Connect with me on LinkedIN

Blocking Apps from Using EWS

If your reading this post, you were probably asked by your security team to block a certain app or apps from accessing Office 365 (Exchange Online). There are all kinds of security reasons that you would need to block applications from using Exchange Web Services (EWS). I am in no way picking on any one application, the one shown in the post below just happens to be the one that I was asked to block by a client. Their security team reviewed the app and it didn’t meet their corporate security policy.

In order to block EWS applications, we need to use the Set-OrganizationConfig command, and then specify two EWS parameters.

 

Let’s first review your organization and see if you have a Block List setting and if there are applications in there.

 

Connect to Exchange Online with PowerShell

 

$UserCredential = Get-Credential

 

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

 

Import-PSSession $Session

 

Verify Existing Settings

 

Get-OrganizationConfig |ft Name,EwsApplicationAccessPolicy,EwsBlockList,EwsAllowList

 

From the results above we can see that the EwsApplicationAccessPolicy is not set and there is nothing in the EwsBlockList or the EwsAllowList

 

Understand the Process (EwsApplicationAccessPolicy and EwsBlockList or EwsAllowList)

 

There are two basic methods to blocking applications. Most companies that I work with want to allow everything and target specific apps to block.

 

You can block everything except everything on the allow list; EnforceAllowList

-or-

You can allow everything and except what’s on the block list; EnforceBlockList

 

-EwsApplicationAccessPolicy <EnforceAllowList | EnforceBlockList>

The EwsApplicationAccessPolicy parameter defines which applications other than Entourage, Mac Outlook, and Outlook can access EWS. If set to EnforceAllowList, only applications specified in the EwsAllowList parameter are allowed access to EWS. If set to EnforceBlockList, every application is allowed access to EWS except the ones specified in the EwsBlockList parameter.

 

-EwsBlockList

The EwsBlockList parameter specifies the applications that can’t access EWS when the EwsApplicationAccessPolicy parameter is set to EnforceBlockList.

 

-EwsAllowList

The EwsAllowList parameter specifies the applications (user agent strings) that can access EWS when the EwsApplicationAccessPolicy parameter is set to EnforceAllowList.

 

 

Enable the Block List and add an Application

 

This method will show how to allow all applications (that use EWS) and only block ones on the block list. You’ll see the command to block a specific application and then the confirmation command after.

 

Set-OrganizationConfig –EwsApplicationAccessPolicy:EnforceBlockList –EwsBlockList:”CloudMagic*”

 

Given some replication and policy time the user will see this.

 

Thanks for visiting and reading my posts. I am always looking for more ideas. Please comment or email me with what you would like to see.

Kelsey Epps Office365 MVP

Email Me Follow me on Twitter Connect with me on LinkedIN

Modify Recoverable Items Folder – RetainDeletedItemsFor

Once you delete items from Outlook or have retention policies delete the data, it will end up in the Recoverable Items Folder. This post will detail how to check for and modify the time in which that data sits in the Recoverable Items Folder, before it’s purged from Exchange Online.

Chances are if you are reading this you know what the Recoverable Items Folder is and you know why you want to change the default time for the folder. Please be careful and be knowledgeable about how and what you are modifying here.  If you are unsure about the Recoverable Items Folder, please view the Microsoft TechNet article below. Consider this as your warning.

https://technet.microsoft.com/en-us/library/ee364755(v=exchg.150).aspx

 

Per Microsoft:

To protect from accidental or malicious deletion and to facilitate discovery efforts commonly undertaken before or during litigation or investigations, Microsoft Exchange Server 2013 and Exchange Online use the Recoverable Items folder. The Recoverable Items folder replaces the feature that was known as the dumpster in earlier versions of Exchange. The Recoverable Items folder is used by the following Exchange features:

  • Deleted item retention
  • Single item recovery
  • In-Place Hold
  • Litigation Hold
  • Mailbox audit logging
  • Calendar logging

 

This BLOG post will walk through the steps of setting the RetainDeletedItemsFor value for both the Mailbox and the Mailbox Plan in Office 365 (Exchange Online). The Microsoft default value for this setting is 14 days. The value is modified with PowerShell connection to Exchange Online. One thing to note is that if you have changed the default value on premise, you will also have to set the same value in Exchange Online as the mailbox you are moving to Exchange Online will get the value from Exchange Online.

 

View the current MailboxPlan settings in Exchange Online

Get-MailboxPlan |ft Name,RetainDeletedItemsFor

 

View the current setting per mailbox in Exchange Online

Get-Mailbox -Identity User.Name | fl Identity,RetainDeletedItemsFor

 

View the current setting all Mailboxes in Exchange Online

Get-Mailbox | fl Identity,RetainDeletedItemsFor

Note that some of the names have been blacked out for security purposes. Yes, people try to hack the users in my blog posts, even though I only use them once and they are deleted after.


 

Changing the Default Values

The value can be changed per mailbox or for the whole mailbox plan. Per mailbox is just as it sounds, it’s only for that one mailbox. Per mailbox plan will catch all the newly created mailboxes (including those migrated). It’s important to note that if you modify the setting after mailboxes have been created or migrated to Exchange Online, you will have to modify the value on those mailboxes as well as the mailbox plan. Basically after modifying the mailbox plan, all new mailboxes will get the new setting, while existing mailboxes will have to be updated.

 

The default value is set to 14 days. The max value that you can set is 30 days.

 

Change the current setting for the MailboxPlan in Exchange Online

Get-MailboxPlan | Set-MailboxPlan -RetainDeletedItemsFor XX

The screen shot below shows the command to change the setting, followed by the command to verify.

 

Change the current setting per mailbox

Set-Mailbox –Identity username@domain.com -RetainDeletedItemsFor XX

The screen shot below shows the command to change the setting, followed by the command to verify.

 

Thanks for visiting and reading my posts. I am always looking for more ideas. Please comment or email me with what you would like to see.

Kelsey Epps Office365 MVP

Email Me Follow me on Twitter Connect with me on LinkedIN