<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Chris Pollitt</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/chris_pollitt/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/chris_pollitt/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:28:41 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Exchange Online: Looping through large numbers of objects, a PowerShell example</title>
      <link>https://docs.microsoft.com/archive/blogs/chris_pollitt/exchange-online-looping-through-large-numbers-of-objects-a-powershell-example</link>
      <pubDate>Mon, 29 Jan 2018 06:30:49 GMT</pubDate>
      <dc:creator><![CDATA[chrispol]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chris_pollitt/?p=255</guid>
      <description><![CDATA[Sometimes it is necessary to run a command against a large number of objects.  The simplest way to...]]></description>
      <content:encoded><![CDATA[Sometimes it is necessary to run a command against a large number of objects.  The simplest way to do this is with a pipe like in this example where litigation hold is enabled for all users:

get-mailbox -resultsize unlimited | set-mailbox -litigationholdenabled $true -litigationholdduration 3660

&nbsp;

However, as you get into thousands or tens of thousands of users this may start to run into a couple of problems:
<ul>
 	<li>running time can become quite high.  This is because the Pipe operation takes place in the memory of your local PowerShell client.  All the data from get-mailbox has to be brought down to your PC before the Pipe operation can take place.</li>
 	<li>high memory consumption (because all that data has to be stored before the pipe is executed)</li>
 	<li>Disconnects of the PowerShell session</li>
 	<li>You could get throttled while running the command</li>
</ul>
You can get around these problems with Matt Byrd's EHLO blog.  It is posted here:

https://blogs.technet.microsoft.com/exchange/2015/11/02/running-powershell-cmdlets-for-large-numbers-of-users-in-office-365/

&nbsp;

I have had some of my customers complain that this is too complex or state that they wanted to make customizations.

&nbsp;

This blog is about a simpler version.  I am attaching an example that loops through all the objects.  As it does so it saves a record of every operation it completes.  That way if the script fails or gets interrupted it can exclude the completed entries from what it has already done.  The script regularly tears down the PowerShell session and recreates it.

Hopefully I have included enough comments in the example that you will be able to modify it to suite your needs.  It is expected all the PowerShell code included here would be saved as a PS1 file and then modified to suit your needs.  This particular example retrieves all User Mailboxes and then makes sure the RetainDeletedItemsFor property is set to the default of 14 days.

&nbsp;

Thanks

&nbsp;

Chris

&nbsp;

The example:

&nbsp;

#

# Change RetainDeletedItemsFor to a specific value for all usermailboxes in the Exchange Online

# tenant.

#

# Data for each mailbox is written to disk as it is processed. If the script is run twice

#with the same file name and path the script will load the file and use the file to exclude

#mailboxes that have already been processed.

# As each mailbox is processed a line is appended to the Output file. If the script is interrupted

#it can resume based upon the content of the file. Simply make sure that you specify the exact same

#path and file name the next time you run the script.

#

# Parameters:

#     Script takes the absolute path to a CSV file. For example:

#           c:\o365\monthlyscript\Dec2015LastLogon.csv

#

# Script author: Chris Pollitt

# Last Modified: 2017-12-07

# Script provided as is without warranty of any kind. Use at your own risk.

#

&nbsp;

param (

[string]$FileAndPath

)

&nbsp;

# Pull the full list of mailboxes. Only pulling user mailboxes since Shared don't normally have licenses.

# Using invoke command so that pulling the full list of mailboxes takes only 2-4 minutes. Without the invoke this would be

# much slower, consume more RAM and be prone to hitting throttling limits outside of the invoke-command.

# Requires PowerShell 4.0 or higher

[array]$Mbxs = @()

[array]$Mbxs = invoke-command -session $session -scriptblock {Get-mailbox -RecipientTypeDetails usermailbox -resultsize unlimited | select-object userprincipalname,retaindeleteditemsfor}

# NOTE the use of $Session in the statements used in the Invoke-command. The Invoke needs to use the variable

#tied to the current PowerShell logon. If you use a different variable please change this.

&nbsp;

$OptionsForSession = New-PSSessionOption

$OptionsForSession.SkipRevocationCheck = $true

&nbsp;

if( $Mbxs.count -eq 0 )

{

write-host "Failed to retrieve list of mailboxes. "

$Count = (get-mailbox -RecipientTypeDetails usermailbox -resultsize unlimited).count

write-host "Number of mailboxes in the Org is " $Count

write-host "If the invoke-command did not return this please let author know."

exit

}

&nbsp;

Write-host "initial mailboxes found " $Mbxs.count

write-host "Elimintating mailboxes where RetainDeletedItemsFor is already the desired value"

$Mbxs = $Mbxs | ?{$_.retaindeleteditemsfor -ne "14.00:00:00"}

&nbsp;

if($Mbxs.count -eq 0) {

write-host "All mailboxes are set to 14.00:00:00 for RetainDeletedItemsFor. Script exiting."

exit

}

else {

write-host $Mbxs.count "mailboxes are not set to 14.00:00:00 for RetainDeletedItemsFor. "

}

&nbsp;

[array]$LastUserChanged = @() #declare an empty array

[array]$UniqueMbxs = @()

$Resuming = $false

&nbsp;

if(test-path $FileAndPath)

{

write-host "Found the output file. Assume we are resuming from a previous run"

&nbsp;

[array]$PreviousProgress = import-csv -path $FileAndPath

&nbsp;

if( $PreviousProgress.count -ne 0) #Make sure file is not empty.

{

$Resuming = $true

[array]$UniqueMbxs = compare-object -ReferenceObject $Mbxs.userprincipalname -DifferenceObject $PreviousProgress.userprincipalname -passthru | ?{$_.sideindicator -eq “&lt;=”}

#Assert that $UniqueMbxs is an array that only contains UPNs at this point. If $PreviousProgress had additional properties

#they are now stripped out because all we need is a unique way to identify the mailbox.

write-host "Previously " $PreviousProgress.count " mailboxes were processed."

write-host ($Mbxs.count - $PreviousProgress.count) "mailboxes remain."

&nbsp;

If( $Mbxs.count -eq $PreviousProgress.count )

{

Write-host “Number of mailboxes equals number of mailboxes in source file. Exiting script.”

Exit

}

&nbsp;

}

else

{

write-host "Attempted to import previous file. No records found in the file. Treating this as a new execution of the script."

[array]$UniqueMbxs = $Mbxs

}

}

else

{

[array]$UniqueMbxs = $Mbxs

}

&nbsp;

$Mbxs = $NULL             #Clear array not being used

$PreviousProgress = $NULL #Clear array not being used

&nbsp;

#release memory of arrays set to $NULL

[gc]::collect()

&nbsp;

write-host $UniqueMbxs.count

$loopProgress = 1

$StatsSession = get-pssession

$Credential = get-credential -message "Please supply the stats script with credentials"

write-host " "

&nbsp;

foreach($m in $UniqueMbxs)

{

&nbsp;

if( ($Session.state -ne "Opened") -or (($loopProgress % 100) -eq 0))

{

write-host " "

Write-host "Removing Existing PS Sessions"

&nbsp;

# Destroy any outstanding PS Session

Get-PSSession | Remove-PSSession -Confirm:$false

&nbsp;

# Sleep 30s to allow the sessions to tear down fully

Write-host "Sleeping 30s for Session Tear Down"

Start-Sleep -Seconds 30

&nbsp;

Write-host "Creating new PS Session"

write-host " "

&nbsp;

# Create the session

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "<a href="https://outlook.office365.com/powershell-liveid/">https://outlook.office365.com/powershell-liveid/</a>" -Credential $Credential -Authentication Basic -AllowRedirection -SessionOption $OptionsForSession

$null = Import-PSSession $Session -AllowClobber

} #EndIf

if ($Resuming) #$UniqueMbxs can have two formats. This affects syntax used to reference the data

{

set-mailbox $m -RetainDeletedItemsFor 14.00:00:00 #NOTE there is an inherent assumption on this line that the set-mailbox

#is successful. There is no Trap or exception checking here.  To make this more robust the command could be wrapped in a

#Try Catch structure.

$Last = $m

}

else # Script is not resuming after a previous run

{

set-mailbox $m.userprincipalname -RetainDeletedItemsFor 14.00:00:00

$Last = $m.userprincipalname #NOTE there is an inherent assumption on this line that the set-mailbox is successful. There is not Trap or exception checking here.

} #EndIf

&nbsp;

write-host "." -nonewline #Print a period with every record processed. Gives visual indication script is running.

sleep 1 #This is 1 second, but might need to be adjusted upwards if the script hits throttling limits.

#with session teardown and recreate every 100 objects you might even be able to comment this out.

[array]$LastUserChanged += $Last

$Last | Export-csv -append -path $FileAndPath -notypeinformation #If file does not exist it should be created.

$Last = $NULL   #Clearing $Last in the hope that forcing it clear after writing will prevent odd duplication issue on subsequent times through the loop

$loopProgress++

} #Next

&nbsp;

#$LastUserChanged #dumps the contents of variable to the screen

write-host "Script complete."

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>External users cannot open encrypted messages</title>
      <link>https://docs.microsoft.com/archive/blogs/chris_pollitt/external-users-cannot-open-encrypted-messages</link>
      <pubDate>Thu, 30 Nov 2017 21:31:06 GMT</pubDate>
      <dc:creator><![CDATA[chrispol]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chris_pollitt/?p=245</guid>
      <description><![CDATA[When an external user tries to view the contents of an encrypted message from your organization they...]]></description>
      <content:encoded><![CDATA[When an external user tries to view the contents of an encrypted message from your organization they see the following error message after trying to enter the one time passcode:  "Sorry, we can't display your message right now
Something went wrong and your encrypted message couldn't be opened. Please try again by following the instructions in the original email message in 5 minutes."

&nbsp;

A common cause of this is the mixing of the older Exchange based Office Message Encryption and the newer Azure RMS encryption that is emerging in the service.

To see if you are mingling these you need to do two things.
<ol>
 	<li>run get-irmconfiguration and check to see if AzureRMSLicensingEnabled is set to True</li>
 	<li>Look at your Transport Rule that encrypts the message.  Is the action "Encrypt the meaasge with Office 365 Message Encrption"?</li>
</ol>
If both of these are conditions are met you are mingling two different versions of Microsoft's encryption technologies.  The external recipient will never be able to open the messages.

Note:  The responses you get from test-irmconfiguration are very different for each of the two IRM versions.  Thus these results can also contribute as evidence.  The full responses in each configuration are not included in this article.

You can get further proof that you are in this situation by collecting a Fiddler of the failed attempt to access the unencrypted contents of the message.  The JSON tab of the response will show one of these error messages:
<ul>
 	<li>MessageText=The specified object was not found in the store., Cannot decode the message -itemId: E4E_M_edc899287-179d-4ab4-a115-a9e2784d1dd2, -currentUser user42@contoso.com</li>
 	<li>Cannot decode the message -itemId: E4E_M_fcf2a6f5-1396-434f-b376-67a0e2a01478, -currentUser user42@contoso.com","ResponseCode":"ErrorRightsManagementPermanentException","ResponseClass":"Error","Items":null"</li>
</ul>
&nbsp;

There are two ways to address this.  The simplest is you can force the system back to OMEv1 by using this command:

Set-IRMConfiguration -<span style="float: none;background-color: transparent;color: #333333;cursor: text;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size: 16px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;line-height: 24px;text-align: left;text-decoration: none;text-indent: 0px">AzureRMSLicensingEnabled </span>$False

Now new messages encrypted with the transport rule will work when received by the external recipients.

&nbsp;

The better approach is to modify the Transport Rule's action to "Apply Rights Protection" and then select the Do Not Forward template.

Before proceeding with this modification you should make sure that all implementation steps have been completed.  Here are a couple of articles related to enable Azure Rights Management:

<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Finformation-protection%2Fdeploy-use%2Factivate-service&amp;data=02%7C01%7CScott.Abel%40weightwatchers.com%7C4da00b7dd23e44e31f4708d537a1e785%7C4237e715fc9d4ed18d0bb047f0f0fb8b%7C0%7C0%7C636476090868493794&amp;sdata=bN48GE2MLW7HhP9gpYAbUOrLn6DizOF8ZrBDBu%2FfWko%3D&amp;reserved=0">https://docs.microsoft.com/en-us/information-protection/deploy-use/activate-service</a>

<span style="color: #000000;font-family: Calibri"></span>

<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2FSet-up-new-Office-365-Message-Encryption-capabilities-built-on-top-of-Azure-Information-Protection-7ff0c040-b25c-4378-9904-b1b50210d00e&amp;data=02%7C01%7CScott.Abel%40weightwatchers.com%7C4da00b7dd23e44e31f4708d537a1e785%7C4237e715fc9d4ed18d0bb047f0f0fb8b%7C0%7C0%7C636476090868493794&amp;sdata=By7xUXswuFZc%2BNkknfpU6nBmQkUSTxGv0qNYKjZg%2F4Q%3D&amp;reserved=0">https://support.office.com/en-us/article/Set-up-new-Office-365-Message-Encryption-capabilities-built-on-top-of-Azure-Information-Protection-7ff0c040-b25c-4378-9904-b1b50210d00e</a>]]></content:encoded>
    </item>
    <item>
      <title>Messaging Records Management &amp; confusion with Litigation Hold</title>
      <link>https://docs.microsoft.com/archive/blogs/chris_pollitt/messaging-records-management-confusion-with-litigation-hold</link>
      <pubDate>Mon, 11 Sep 2017 05:15:45 GMT</pubDate>
      <dc:creator><![CDATA[chrispol]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chris_pollitt/?p=226</guid>
      <description><![CDATA[Many customers I speak with are confused by the terminology used with Messaging Records Management...]]></description>
      <content:encoded><![CDATA[Many customers I speak with are confused by the terminology used with Messaging Records Management (MRM).  Often people assume that if you set a Retention Policy the item will be kept for the number of days specified.  For them this implies the items in question will also be protected for that period of time.  This blog's aim is to review the terminology used by MRM and distinguish what MRM can and cannot do.

To help illustrate the differences I will use an example.

A few months ago I had a customer who thought items were being kept in the mailbox longer than intended.  He had set up a Default MRM Deletion tag to remove items that were more than 3 years old.  He had also turned on Litigation Hold on the mailbox.

Here are the properties from the mailbox:

LitigationHoldEnabled                  : True

SingleItemRecoveryEnabled              : True

RetentionHoldEnabled                   : False

LitigationHoldDate                     : 6/7/2016 9:54:28 AM

LitigationHoldOwner                    : admin@contoso.com

LitigationHoldDuration : Unlimited

RetentionPolicy                        : Default MRM Policy

&nbsp;

Here are the properties of the 3 year delete retention tag:

WhenChanged                           : 2016-12-05 9:42:54 AM

WhenCreated                           : 2016-06-29 1:39:10 PM

WhenChangedUTC                        : 2016-12-05 2:42:54 PM

WhenCreatedUTC                        : 2016-06-29 5:39:10 PM

&nbsp;

&nbsp;

In this case the Litigation Hold was applied before the retention policy. One part of the misunderstanding was that the customer thought the Retention setting from the Default tag took precedence over the Litigation Hold. Unfortunately it is exactly the opposite. In this case the words got in the way. The world outside Microsoft gives a different meaning to retention than the developers of Exchange 2010 and MRM gave to it back when this was designed during development back in 2008.
A few definitions/explanations:

&nbsp;

<strong>Litigation Hold</strong> is a blanket that is thrown over the entire mailbox.  When the database engine is asked to permanently remove an item from the Exchange database there is a check to see if the mailbox is protected by Litigation Hold.  If the answer is Yes the item cannot be deleted.  If the answer is No the deletion proceeds and the item is gone forever.  You might say it is a mail item's last chance to avoid destruction.  Litigation Hold ensures an item cannot be permanently removed from the mailbox when it is Younger than the specified age (specified in the LitigationHoldDuration property).  For everything except Calendar Items and Tasks that age is calculated by the date/time at which the item was received.  If there is no Receive Date then the creation date is utilized for the calculation.  Calendar Items and Tasks use the last occurrence as the basis for the calculation instead of the received date.

&nbsp;

<strong>In-Place Hold</strong> has the same effect on permanent deletion of items that Litigation Hold does.  However, the scope of an In-Place is different.  Where Litigation Hold applies to EVERYTHING in the mailbox an In-Place hold utilizes a query to protect items.  For example, Lets assume that only Invoice related items are considered important enough to keep for 3 years.  We could create an In-Place hold that checks the Subject and Message body for the word "Invoice".  IF the word "Invoice" is present on the item its permanent removal from the mailbox will be prevented for 3 years.  If the word is absent the item can be removed as if the In-Place Hold was not there.

&nbsp;

<strong>Retention Policies (aka Messaging Records Management (MRM))</strong> are named a little counter intuitively.  They actually do the opposite of retaining items.   MRM specifies how old the item can be before it is deleted or archived.  One way to look at it is to compare it to the expiry date stamped on some grocery items. The expiry date on the items suggest when they should be thrown away. There is nothing to stop you from throwing them away sooner. The date does not guarantee the item will stay in your kitchen until the date specified. You can almost look at MRM as an automated process that cleans out the kitchen's expired items. MRM does nothing to prevent disposal of the item earlier than the expiry date, that is the job of the legal holds described above.

The original name for MRM before Exchange 2007 released was Email Life Cycle (ELC).  You will still see ELC in some of the results from PowerShell cmdlets and Microsoft's internal documentation.  MRM consists of 3 types of tags.  Each has a different scope and order of precedence.  Here is a summary of each:

<strong>Personal Tags</strong> - These are manually applied to an item by the user by right-clicking the item and assigning the personal tag (often called a policy in Outlook).  Personal tags can be applied to most items inside a mailbox.  Because they are manually applied by a user they take precedence over the other two types of tags.  It is assumed the user knows best when they apply this type of tag.  Personal tags can archive items to the Archive Mailbox or they can order the deletion of an item.

<strong>Folder Tags (aka RPT tags)</strong> - Folder tags can only be applied to the default folders that appear in all Exchange Mailboxes.  The only action they can carry out is delete.  They are considered to be more important than a default tag.  If a folder tag is created it applies to the folder in Both the primary mailbox and the Archive Mailbox.

<strong>Default Tags (aka DPT tags)</strong> - These are applied when an item is not subject to either of the previous tags.

&nbsp;

<strong>What does RetentionHoldEnabled do?</strong>

If you want to suspend MRM's functionality (prevent any of its tags from being acted upon) you can run:

Set-Mailbox myuser@contoso.com -RetentionHoldEnabled $True -EndDateForRetentionHold 12/12/2017 -StartDateForReten
tionHold 11/11/2017

The start and end dates are optional if you want an indefinite hold (just remember to remove it before calling support about a MRM policy that is not working).

To use the analogy above this will keep the items in the fridge until after the EndDateForRetentionHold.  This is useful if you know someone is going on leave for an extended period.  It allows you to suspend MRM until they have been back for a little while and thus give the user a chance to catch up.

&nbsp;

<strong>Recoverable Items\Deletions</strong> - This folder maps to the Recover Deleted Items functionality in Outlook and OWA.  Any item in this folder can be recovered with the standard mail clients.  How long items stay in this folder is governed by the RetainDeletedItemsForproperty of the mailbox (this property is visible when you output the results of get-mailbox).

<strong>Recoverable Items\Purges</strong> - This folder houses items that have been deleted for more than RetainDeletedItemsFor days AND that are protected by Litigation Hold.

<strong>Recoverable Items\DiscoveryHolds</strong> - This folder houses items that have been deleted for more than RetainDeletedItemsFor days AND that are protected by In-Place Hold.

&nbsp;

&nbsp;

The Life cycle of an email

&nbsp;

For all of these examples we will make three assumptions:

Single Item recovery is enabled for the mailbox (the default in Exchange Online)

The RetainDeletedItemsFor property of the mailbox is set to 14 days with this value:  14.00:00:00

When a Litigation Hold or In-Place Hold is used the duration of this hold is 3 years.  The 3 years is recorded as 1096 days to account for the possibility of a leap year.

&nbsp;

&nbsp;

<strong>Scenario 1:</strong>  A Mailbox with no Retention Policy or Litigation/In-Place Hold.  User Just reads the Item.
<ul>
 	<li>An item arrives in the mailbox on March 1<sup>st</sup> 2012 at 15:37:16.714 UTC time.</li>
 	<li>The user reads the item on March 10<sup>th</sup> 2012 at 02:19:47:917 UTC time and never takes action on the item again.</li>
 	<li>Today this item would still be sitting in the Inbox.</li>
</ul>
&nbsp;

&nbsp;

<strong>Scenario 2:</strong>  A Mailbox with no Retention Policy or Litigation/In-Place Hold.  User deletes the item a few weeks after reading it.
<ul>
 	<li>An item arrives in the mailbox on March 1<sup>st</sup> 2012 at 15:37:16.714 UTC time.</li>
 	<li>The user reads the item on March 10<sup>th</sup> 2012 at 02:19:47:917 UTC time.</li>
 	<li>The user Shift deletes the item on April 3<sup>rd</sup> 2012 at 20:05:52.574.  The mail item moves from Inbox to Recoverable Items\Deletions at the time of the Shift+delete.  Shift+Delete is considered a Hard Delete.  Without SingleItemRetention=$true the item would disappear from the mailbox instantly.  Since SingleItemRetention is the default behaviour for Exchange Online mailboxes the message moves to the Deletions folder.</li>
 	<li>On April 17<sup>th</sup>, 2012 at 20:05:52.575 the item is no longer protected by the RetainDeletedItemsFor property.  The database engine permanently removes the item within a few minutes.</li>
</ul>
&nbsp;

&nbsp;

<strong>Scenario 3a:</strong>  A Mailbox with no Retention Policy.  The mailbox has a 3 year Litigation Hold.  User deletes the item a few weeks after reading it.
<ul>
 	<li>An item arrives in the mailbox on March 1<sup>st</sup> 2012 at 15:37:16.714 UTC time.</li>
 	<li>The user reads the item on March 10<sup>th</sup> 2012 at 02:19:47:917 UTC time.</li>
 	<li>The user Shift deletes the item on April 3<sup>rd</sup> 2012 at 20:05:52.574.  The mail item moves from Inbox to Recoverable Items\Deletions at the time of the Shift+delete.  Shift+Delete is considered a Hard Delete.</li>
 	<li>On April 17<sup>th</sup>, 2012 at 20:05:52.575 the item is no longer protected by the RetainDeletedItemsFor property.  The database engine attempts to permanently remove the item within a few minutes.  The removal attempt cannot proceed because of the Litigation Hold.  The server does not want to leave the item where it can be recovered by Outlook or OWA.  Therefore it moves the item to the Purges folder.</li>
 	<li>On March 2<sup>nd</sup>, 2015 at 15:37:16.715 UTC time the protection of the Litigation Hold ends.  The database engine permanently removes the mail item from the Purges Folder.</li>
</ul>
&nbsp;

&nbsp;

<strong>Scenario 3b:</strong>  A Mailbox with no Retention Policy.  The mailbox has a 3 year Litigation Hold.  User deletes the item a little more than 5 years after reading it.
<ul>
 	<li>An item arrives in the mailbox on March 1<sup>st</sup> 2012 at 15:37:16.714 UTC time.</li>
 	<li>The user reads the item on March 10<sup>th</sup> 2012 at 02:19:47:917 UTC time.</li>
 	<li>The user Shift deletes the item on April 3<sup>rd</sup> 2017 at 20:05:52.574.  The mail item moves from Inbox to Recoverable Items\Deletions at the time of the Shift+delete.  Shift+Delete is considered a Hard Delete.</li>
 	<li>On April 17<sup>th</sup>, 2017 at 20:05:52.575 the item is no longer protected by the RetainDeletedItemsFor property.  The database engine attempts to permanently remove the item within a few minutes.  The removal attempt succeeds because the Litigation Hold only protected this item for 1096 days from its arrival on March 1<sup>st</sup> 2012 at 15:37:16.714 UTC time.  Therefore any delete of the item at or after March 2<sup>nd</sup>, 2015 at 15:37:16.715 UTC time proceeds as if there was no Litigation Hold in place.</li>
</ul>
&nbsp;

&nbsp;

<strong>Scenario 4a:</strong>  A Mailbox with a 3 year delete Retention Policy.  The mailbox has a 3 year Litigation Hold.  User deletes the item a few weeks after reading it.
<ul>
 	<li>An item arrives in the mailbox on March 1<sup>st</sup> 2012 at 15:37:16.714 UTC time.</li>
 	<li>MRM stamps the item with a retention date of March 1<sup>st</sup> 2015 at 15:37:16.714 UTC time.</li>
 	<li>The user reads the item on March 10<sup>th</sup> 2012 at 02:19:47:917 UTC time.</li>
 	<li>The user Shift deletes the item on April 3<sup>rd</sup> 2012 at 20:05:52.574.  The mail item moves from Inbox to Recoverable Items\Deletions at the time of the Shift+delete.  Shift+Delete is considered a Hard Delete.</li>
 	<li>On April 17<sup>th</sup>, 2012 at 20:05:52.575 the item is no longer protected by the RetainDeletedItemsFor property.  The database engine attempts to permanently remove the item within a few minutes.  The removal attempt cannot proceed because of the Litigation Hold.  The server does not want to leave the item where it can be recovered by Outlook or OWA.  Therefore it moves the item to the Purges folder.</li>
 	<li>On March 2<sup>nd</sup>, 2015 at 15:37:16.715 UTC time the protection of the Litigation Hold ends.  The database engine permanently removes the mail item from the Purges Folder.  <strong>In this instance the 3 year delete policy has no effect on how the item is handled.</strong></li>
</ul>
&nbsp;

&nbsp;

<strong>Scenario 4b:</strong>  A Mailbox with a 2 year Default Permanent Delete tag in the MRM policy.  The mailbox has a 3 year Litigation Hold.  User forgets the item after reading it.
<ul type="disc">
 	<li>An item arrives in the mailbox on March 1<sup>st</sup> 2012 at 15:37:16.714 UTC time.</li>
 	<li>MRM stamps the item with a retention date of March 1<sup>st</sup> 2014 at 15:37:16.714 UTC time.</li>
 	<li>The user reads the item on March 10<sup>th</sup> 2012 at 02:19:47:917 UTC time.</li>
 	<li>MRM's ManagedFolderAssistant completes at 15:30 on March 1<sup>st</sup>, 2014.  The item is not deleted this day because MRM completed a few minutes before the expiry time of 15:37:16.714 UTC.</li>
 	<li>MRM get throttled on each of the next 4 days and terminates for the day without deleting the item.</li>
 	<li>The deletion that moves the item from Inbox to Recoverable Items\Purges takes place on March 6<sup>th </sup>2015 at 15:29:28.520 UTC time.</li>
 	<li>On March 1st 2015 at 15:37:<span style="float: none;background-color: transparent;color: #333333;cursor: text;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size: 16px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;line-height: 24px;text-align: left;text-decoration: none;text-indent: 0px">16.714</span> UTC time the item is no longer protected by the 3 year litigation hold.  The database engine deletes it within minutes.</li>
</ul>
&nbsp;

<strong>Scenario 4c:</strong> A Mailbox with a 3 year Default Permanent Delete tag in the MRM policy. The mailbox has a 3 year Litigation Hold. User forgets the item after reading it.
<ul>
 	<li>An item arrives in the mailbox on March 1st 2012 at 15:37:16.714 UTC time.</li>
 	<li>MRM stamps the item with a retention date of March 1st 2015 at 15:37:16.714 UTC time.</li>
 	<li>The user reads the item on March 10th 2012 at 02:19:47:917 UTC time.</li>
 	<li>MRM's ManagedFolderAssistant completes at 15:30 on March 1st, 2015. The item is not deleted this day because MRM completed a few minutes before the expiry time of 15:37:16.714 UTC.</li>
 	<li>MRM get throttled on each of the next 4 days and terminates for the day without deleting the item.</li>
 	<li>The Managed Folder Assistant (MRM)  moves the item from Inbox to Recoverable Items\Purges on March 6th 2015 at 15:29:28.520 UTC time.</li>
 	<li>On March 20th 2015 at 15:29:28.521 UTC time the item is no longer protected by the RetainDeletedItemsFor (this mailbox property defaults to 14 days). The database engine deletes it within minutes. The 3 year litigation hold does not prevent the removal from the Purges folder because the Litigation hold only protected the item from deletion between March 1st 2012 at 15:37:16.714 UTC and March 1st, 2015 at 15:37:16.714 UTC</li>
</ul>
&nbsp;

None of these scenarios cover the item moving through the deleted Items folder.  This is partly because it changes nothing with regard to the operations I am trying to demonstrate and partly because this post is just getting to be too long. 😊

&nbsp;

Going back to the initial example near the top of this post...
Assume the customer's intention had been to purge all items more than 3 years old in the mailbox, and then begin a litigation hold of unlimited duration. They should apply the MRM policy to the mailbox first. For the retention policy to be effective I would recommend that the tag and policy be created and applied to the mailbox at least two weeks before the Litigation Hold is applied.  Messaging Records Management (MRM) tries to run once per day, but Microsoft only supports one completion per week.    It is a heavily throttled process. MRM is stopped any time the server shows that it is too busy. Terminating MRM removes an extra task may hinder the experience of users connected to the server.  I recommend two weeks instead of one as it often takes two complete executions of MRM to purge items.

&nbsp;

&nbsp;

Chris Pollitt]]></content:encoded>
    </item>
    <item>
      <title>Testing Impersonation Permission with EWS Editor</title>
      <link>https://docs.microsoft.com/archive/blogs/chris_pollitt/testing-impersonation-permission-with-ews-editor</link>
      <pubDate>Wed, 01 Feb 2017 07:20:56 GMT</pubDate>
      <dc:creator><![CDATA[chrispol]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chris_pollitt/?p=156</guid>
      <description><![CDATA[A question that comes up occasionally with support is whether Impersonation is broken within...]]></description>
      <content:encoded><![CDATA[A question that comes up occasionally with support is whether Impersonation is broken within Exchange Online.  This article covers how to test impersonation using the November 2016 edition of EWSEditor.

EWSEditor is available from https://ewseditor.codeplex.com.  Once it is downloaded and unzipped you can run ewseditor.exe.  If you don't have the proper version of .Net installed you will be prompted to get it and install it.  I recommend checking Windows Update after the .Net install to make sure you pick up all appropriate updates.

One other pre-requisite is to make sure the account you are using for impersonation has been assigned the proper roles.  Here is an example of using PowerShell to assign the ApplicationImpersonation role to one of the accounts in my lab tenant:
<p lang="en-US" style="margin: 0in;color: #c00000;font-family: 'Courier New';font-size: 11pt">$O365Cred = (Get-Credential)</p>
<p lang="en-US"># Enter your credentials when prompted</p>
<p lang="en-US" style="margin: 0in;font-family: 'Courier New';font-size: 11pt"><span>$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "</span><a href="https://ps.outlook.com/powershell/">https://ps.outlook.com/powershell/</a><span>" -Credential $O365Cred -Authentication Basic -AllowRedirection</span></p>
<p lang="en-US" style="margin: 0in;color: #c00000;font-family: 'Courier New';font-size: 11pt">Import-PSSession $session</p>
Get-ManagementRole | ?{$_.name -like "*imp*"}

Name                     RoleType
----                     --------
ApplicationImpersonation ApplicationImpersonation
Mailbox Import Export    MailboxImportExport
New-ManagementRoleAssignment -name "user010 is impersonator" -role applicationimpersonation -user user010

Name                           Role                RoleAssigneeName    RoleAssigneeType    AssignmentMethod    EffectiveUserName
----                           ----                ----------------    ----------------    ----------------    -----------------
user010 is impersonator        ApplicationImper... user010             User                Direct

&nbsp;

Once you assign the role allow a little bit of time before attempting to proceed.  Sometime 5 minutes is enough, but I generally recommend up to an hour to make sure the change replicates to all systems.  Even with the delay you will need to log out of all sessions and log back in for the change to take effect.  Permissions are evaluated when you first open each web or PowerShell session.

&nbsp;

When you first open EWSEditor you will see:

<a href="https://msdnshared.blob.core.windows.net/media/2017/02/001Splash.png"><img width="300" height="214" class="alignnone size-medium wp-image-165" alt="001splash" src="https://msdnshared.blob.core.windows.net/media/2017/02/001Splash-300x214.png" /></a>

Click OK and then from the File menu select New Exchange Service

<a href="https://msdnshared.blob.core.windows.net/media/2017/02/002Menu.png"><img width="277" height="180" class="alignnone size-full wp-image-175" alt="002menu" src="https://msdnshared.blob.core.windows.net/media/2017/02/002Menu.png" /></a>

&nbsp;

Assuming you are using Exchange Online fill out the highlighted fields as demonstrated below:

<a href="https://msdnshared.blob.core.windows.net/media/2017/02/004ImpersonationChoicesHighlighted.png"><img width="300" height="173" class="alignnone size-medium wp-image-195" alt="004impersonationchoiceshighlighted" src="https://msdnshared.blob.core.windows.net/media/2017/02/004ImpersonationChoicesHighlighted-300x173.png" /></a>

You can choose to use Autodiscover, but for Exchange Online the fastest and easiest option is to click 365 Default.  User Name is the User Principal Name of the account that has impersonation permission.  The account you wish to impersonate goes in the upper right corner.

If there is any problem with the steps taken to this point you will see a window like the one below when you click OK.

<a href="https://msdnshared.blob.core.windows.net/media/2017/02/005NoPermission.png"><img width="300" height="209" class="alignnone size-medium wp-image-205" alt="005nopermission" src="https://msdnshared.blob.core.windows.net/media/2017/02/005NoPermission-300x209.png" /></a>

&nbsp;

If everything goes well you will see:

<a href="https://msdnshared.blob.core.windows.net/media/2017/02/006Success.png"><img width="300" height="110" class="alignnone size-medium wp-image-215" alt="006success" src="https://msdnshared.blob.core.windows.net/media/2017/02/006Success-300x110.png" /></a>

Click Yes and you will gain access to the mailbox.  You can see you are carrying out the impersonation by the text in the title bar and in the bar at the bottom.  In my sample I have blanked out the user names, but left the domain of my lab tenant.

<a href="https://msdnshared.blob.core.windows.net/media/2017/02/007MoreSuccess.png"><img width="300" height="223" class="alignnone size-medium wp-image-225" alt="007moresuccess" src="https://msdnshared.blob.core.windows.net/media/2017/02/007MoreSuccess-300x223.png" /></a>

&nbsp;

If you are able to reach the a state like that of the screen shot above then Impersonation is functioning in Exchange Online.  If you are having trouble getting a particular application to work it is possible you will need to engage support for that product.  If you have created your own application you may need to engage Microsoft's Developer Messaging team for assistance.

&nbsp;

Chris

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Divide Discovery and In-Place hold searches into smaller units</title>
      <link>https://docs.microsoft.com/archive/blogs/chris_pollitt/divide-discovery-and-in-place-hold-searches-into-smaller-units</link>
      <pubDate>Sun, 31 Aug 2014 13:42:00 GMT</pubDate>
      <dc:creator><![CDATA[chrispol]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chris_pollitt/2014/08/31/divide-discovery-and-in-place-hold-searches-into-smaller-units/</guid>
      <description><![CDATA[This blog has been in the works for longer than I would like to admit :).&nbsp; Since starting a few...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family:Calibri;font-size:medium;">This blog has been in the works for longer than I would like to admit :).&nbsp; Since starting a few things have changed.&nbsp; For example when this was first started in the fall the maximum number of mailboxes in a Discovery Search was 5000.&nbsp; Today it is 10,000.&nbsp; In time the limit will probably change again or it may even disappear at some point.&nbsp; For the moment however the primary focus of this blog is to present a script that will show you how to create searches for a specific number of primary mailboxes (Discovery mailboxes go against the count of 10,000, but are not listed individually in the list of mailboxes to be searched).</span></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:medium;">Why do this?&nbsp; There are two reasons.</span></p>
<ul>
<li><span style="font-family:Calibri;font-size:medium;">If you have a search that is failing or timing out a common troubleshooting step is to try the same search on a single mailbox.&nbsp; If it works then the next question is does it work with 10 mailboxes?&nbsp; a 100?&nbsp; 500?&nbsp; Once you discover a comfortable threshold you might have thousands (in some Office 365 tenants hundreds of thousands) of mailboxes that need to have the same search applied.&nbsp; Creating all of those searches by hand is at best tedious and at worst impossible.&nbsp;&nbsp;The mailbox selection dialog in the web interface shows 500 mailboxes.</span></li>
<li><span style="font-family:Calibri;font-size:medium;">You need to apply the search to more than 10,000 mailboxes.</span></li>
</ul>
<p></p>
<p><span style="font-family:Calibri;font-size:medium;">If you need to know more about the basics of Discovery Searches before reading further&nbsp;</span><span style="font-family:Calibri;font-size:medium;">you can get a great overview&nbsp;of how to handle Discovery Searches and in-place hold from part I and II of this blog:</span></p>
<p><a href="/b/exchange/archive/2012/09/26/in-place-e-discovery-and-in-place-hold-in-the-new-exchange.aspx"><span style="font-family:Calibri;font-size:medium;">https://blogs.technet.com/b/exchange/archive/2012/09/26/in-place-e-discovery-and-in-place-hold-in-the-new-exchange.aspx</span></a></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:medium;">The cloud does have some differences from the on-premise world:</span></p>
<ul>
<li><span style="font-family:Calibri;font-size:medium;">There is a maximum of 10,000 mailboxes per search</span></li>
<li><span style="font-family:Calibri;font-size:medium;">Only 2 searches can run simultaneously (though 32 can be queued)</span></li>
<li><span style="font-family:Calibri;font-size:medium;">In the on-prem world you can precisely <span style="font-family:Calibri;font-size:medium;">measure </span>the load on the server that is doing the Discovery Search.&nbsp; In the cloud this detail is hidden.&nbsp; If your search is failing due to timeouts you may have to break it into smaller pieces or try it at a time fewer administrators of other tenants are doing the same thing.&nbsp; To some extent this is a little like deciding what time of day to go to the bank.&nbsp; If everyone else goes to the back at the same time the Tellers (servers/bank employees) will take longer to serve you.&nbsp; You might even give up and walk away (a timeout error).</span></li>
<li><span style="font-family:Calibri;font-size:medium;">The destination Discovery Mailboxes are capped at 50GB.</span></li>
</ul>
<p><span style="font-family:Calibri;font-size:medium;">NOTE:&nbsp; Please remember that all the numbers given here are subject to change as Office 365 evolves.</span></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:medium;">So how do you work with a large number of users?&nbsp; </span><span style="font-family:Calibri;font-size:medium;">Most administrators find it awkward to deal with the Office 365 web interface for adding thousands of mailboxes to a query because the selection dialog only shows 500 mailboxes.&nbsp; There are a couple ways to deal with this:</span></p>
<ul>
<li><span style="font-family:Calibri;font-size:medium;">Create Distribution Groups with up to 10,000 member in each.&nbsp; You can then base the search off the distribution group&#39;s membership instead of adding the mailboxes</span></li>
<li><span style="font-family:Calibri;font-size:medium;">Use a script like the one I provide in this blog to add the individual mailboxes to each search</span></li>
</ul>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:medium;">The first way has the advantage that once the group is built you need only add one item to the Discovery Search you wish to run (remember the group membership must not exceed 10,000 mailboxes).&nbsp; One catch is that if group membership changes, and the Discovery Search has already been started, the change of group membership is not automatically cascaded into search results.&nbsp; If you want the latest membership changes accounted for you will have to restart the search.</span></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:medium;">Here are a couple of scenarios an administrator might encounter:</span></p>
<p><span style="font-family:Calibri;font-size:medium;">You have 33,000 users that need to have in-place hold instituted.&nbsp; In this example you would need to create&nbsp;4 distribution groups (three of 10,000 members and one of 3000 members).&nbsp; You need not worry about the size of the discovery mailbox because it is not a required parameter for placing an in-place hold.</span></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:medium;">You need to conduct a Discovery Search against 67,000 mailboxes.&nbsp; This would mean creating a minimum of&nbsp;7 distribution groups.&nbsp; However, trying to do searches against thousands of mailboxes might run into the limit on the size of a Discovery Search mailbox (presently 50GB).&nbsp; Avoiding the size limit of the Discovery Search mailbox might cause you to go with 500 mailboxes per Discovery Search to avoid overflowing the Discovery Mailbox.&nbsp; This means creating a lot more than&nbsp;7 groups.&nbsp; It also means creating additional Discovery Mailboxes so no one mailbox is overwhelmed with content.</span></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:medium;">To handle both of these hypothetical examples I have written a script that can create the necessary Discovery Searches and spread them over the list of Discovery Mailboxes that are supplied to the script via a TXT file:</span></p>
<p></p>
<p style="background:white;margin:0cm 0cm 0pt;"><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;">#</span></p>
<p style="background:white;margin:0cm 0cm 0pt;"><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;">#&nbsp; Objective:</span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;">#&nbsp; Create a new Discovery Search for every $mailboxesPerSearch users.&nbsp; The search </span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;"># results are distributed across the Discovery Mailboxes specified in </span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;"># c:\o365\DiscoveryMbxs.txt.&nbsp; The distribution is round robin.&nbsp; The TXT file MUST </span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;"># contain the UPN of each Discovery Mailbox to be used and each UPN should be on its</span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;"># own line of the file.&nbsp; No field name or column heading should be used.&nbsp; THERE MUST</span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;"># BE AT LEAST ONE UPN IN c:\o365\DiscoveryMbxs.txt</span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;">#&nbsp; </span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;">#&nbsp; Each search name will be text followed by a sequential number.&nbsp; For example:&nbsp; </span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;"># Search1, Search2, etc.</span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;">#</span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;">#&nbsp; The script does not start any of the Discovery Searches it creates.</span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;">#</span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;">#&nbsp; For Demonstration purposes this script places 3 mailboxes in each search.&nbsp; You can </span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;"># change this by altering the value of the $mailboxesPerSearch variable.</span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;">#</span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;">#&nbsp;&nbsp; Load the list of discovery mailboxes into a variable.&nbsp; Searches will be distributed</span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;">#&nbsp; across the Discovery mailboxes in round robin fashion.</span></p>
<p><span lang="EN-CA" style="color:darkgray;font-family:&#39;Lucida Console&#39;;font-size:9pt;">[</span><span lang="EN-CA" style="color:teal;font-family:&#39;Lucida Console&#39;;font-size:9pt;">array</span><span lang="EN-CA" style="color:darkgray;font-family:&#39;Lucida Console&#39;;font-size:9pt;">]</span><span lang="EN-CA" style="color:orangered;font-family:&#39;Lucida Console&#39;;font-size:9pt;">$DiscoveryList</span><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;"> <span style="color:darkgray;">=</span> <span style="color:blue;">get-content</span> <span style="color:darkred;">&quot;c:\o365\DiscoveryMbxs.txt&quot;</span>&nbsp;&nbsp; </span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;"># Must use [array] to handle the case where the text file lists only one mailbox.&nbsp; </span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;">#Without Array it gets treated as a string and fails later.</span></p>
<p></p>
<p style="background:white;margin:0cm 0cm 0pt;"><span lang="EN-CA" style="color:orangered;font-family:&#39;Lucida Console&#39;;font-size:9pt;">$DiscoveryCount</span><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;"> <span style="color:darkgray;">=</span> <span style="color:orangered;">$DiscoveryList</span><span style="color:darkgray;">.</span>count</span></p>
<p><span lang="EN-CA" style="color:orangered;font-family:&#39;Lucida Console&#39;;font-size:9pt;">$DiscoveryLoop</span><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;"> <span style="color:darkgray;">=</span> <span style="color:purple;">0</span></span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;</span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;">#&nbsp;&nbsp; Set the number of mailboxes that will be in each search.&nbsp; Acceptable range is 1 to </span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;"># 10000.&nbsp; 3 is selected for illustration purposes in a lab.&nbsp; Remember that discovery </span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;"># mailboxes go against the 10,000 max, but are not listed individually in the search.</span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;"># If all your mailboxes have archives then treat the maximum as 5,000.</span></p>
<p><span lang="EN-CA" style="color:orangered;font-family:&#39;Lucida Console&#39;;font-size:9pt;">$mailboxesPerSearch</span><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;"> <span style="color:darkgray;">=</span> 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;</span></p>
<p><span lang="EN-CA" style="color:orangered;font-family:&#39;Lucida Console&#39;;font-size:9pt;">$base_search_name</span><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;"> <span style="color:darkgray;">=</span> <span style="color:darkred;">&quot;Legal-TESTsearch&quot;</span></span></p>
<p><span lang="EN-CA" style="color:orangered;font-family:&#39;Lucida Console&#39;;font-size:9pt;">$loop_count</span><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;"> <span style="color:darkgray;">=</span> <span style="color:purple;">0</span></span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;</span></p>
<p><span lang="EN-CA" style="color:darkgreen;font-family:&#39;Lucida Console&#39;;font-size:9pt;"># The line below obtains the list of mailboxes to be searched.</span></p>
<p><span lang="EN-CA" style="color:orangered;font-family:&#39;Lucida Console&#39;;font-size:9pt;">$mbxs</span><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;"> <span style="color:darkgray;">=</span> <span style="color:blue;">get-mailbox</span> <span style="color:navy;">-resultsize</span> <span style="color:blueviolet;">unlimited</span> <span style="color:navy;">-RecipientTypeDetails</span> <span style="color:blueviolet;">UserMailbox</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:darkgreen;"># For additional filtering options see the help for get-mailbox</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:darkgreen;"># <a href="https://technet.microsoft.com/en-us/library/bb123685(v=exchg.150).aspx"><span style="color:#0563c1;">https://technet.microsoft.com/en-us/library/bb123685(v=exchg.150).aspx</span></a> and for</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:darkgreen;"># where-object <a href="https://technet.microsoft.com/en-us/library/ee177028.aspx"><span style="color:#0563c1;">https://technet.microsoft.com/en-us/library/ee177028.aspx</span></a></span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;</span></p>
<p><span lang="EN-CA" style="color:orangered;font-family:&#39;Lucida Console&#39;;font-size:9pt;">$MbxRemaining</span><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;"> <span style="color:darkgray;">=</span> <span style="color:orangered;">$mbxs</span><span style="color:darkgray;">.</span>count</span></p>
<p><span lang="EN-CA" style="color:orangered;font-family:&#39;Lucida Console&#39;;font-size:9pt;">$low_bound</span><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;"> <span style="color:darkgray;">=</span> <span style="color:purple;">0</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;</span></p>
<p><span lang="EN-CA" style="color:darkblue;font-family:&#39;Lucida Console&#39;;font-size:9pt;">while</span><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;"> (<span style="color:orangered;">$MbxRemaining</span> <span style="color:darkgray;">-gt</span> <span style="color:purple;">0</span> ) {</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp; <span style="color:darkgreen;">#&nbsp;&nbsp; This loop creates one search per loop and decrements $MbxRemaining by the </span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:darkgreen;"># number of mailboxes included in the search.</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp; <span style="color:orangered;">$loop_count</span> <span style="color:darkgray;">+=</span> <span style="color:purple;">1</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp; </span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:orangered;">$this_search</span> <span style="color:darkgray;">=</span> <span style="color:orangered;">$base_search_name</span> <span style="color:darkgray;">+</span> <span style="color:orangered;">$loop_count</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp; <span style="color:blue;">write-host</span> <span style="color:darkred;">&quot;creating search: &quot;</span> <span style="color:orangered;">$this_search</span> <span style="color:navy;">-foregroundcolor</span> <span style="color:blueviolet;">cyan</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp; <span style="color:darkblue;">if</span>(<span style="color:orangered;">$MbxRemaining</span> <span style="color:darkgray;">-gt</span> <span style="color:orangered;">$mailboxesPerSearch</span>) {</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:darkgreen;">#&nbsp; There are at least $mailboxesPerSearch mailboxes left.&nbsp; </span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:darkgreen;"># This IF branch fills $search_list with $mailboxesPerSearch mailboxes.</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:darkgreen;"># Clear $search_list</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:darkgray;">[</span><span style="color:teal;">array</span><span style="color:darkgray;">]</span><span style="color:orangered;">$search_list</span> <span style="color:darkgray;">=</span> <span style="color:orangered;">$NULL</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:darkgreen;"># Place mailboxes from the current value of low_bound to low_bound plus $mailboxesPerSearch </span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:darkgreen;">#minus one in $search_list</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:orangered;">$mbxs</span><span style="color:darkgray;">[</span><span style="color:orangered;">$low_bound</span><span style="color:darkgray;">..</span>(<span style="color:orangered;">$mailboxesPerSearch</span> <span style="color:darkgray;">*</span> <span style="color:orangered;">$loop_count</span> <span style="color:darkgray;">-</span><span style="color:purple;">1</span>)<span style="color:darkgray;">]</span> <span style="color:darkgray;">|</span> <span style="color:blue;">foreach</span> {</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:darkgray;">[</span><span style="color:teal;">array</span><span style="color:darkgray;">]</span><span style="color:orangered;">$search_list</span><span style="color:darkgray;">=</span><span style="color:orangered;">$search_list</span> <span style="color:darkgray;">+</span> <span style="color:darkgray;">[</span><span style="color:teal;">string</span><span style="color:darkgray;">]</span><span style="color:orangered;">$_</span><span style="color:darkgray;">.</span>UserPrincipalName</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;</span><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;} <span style="color:darkblue;">else</span> {</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:darkgreen;"># This branch fills $search_list with the mailboxes that are left when</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:darkgreen;"># there are less than $mailboxesPerSearch remaining.</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:darkgreen;"># Clear $search_list</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:darkgray;">[</span><span style="color:teal;">array</span><span style="color:darkgray;">]</span><span style="color:orangered;">$search_list</span> <span style="color:darkgray;">=</span> <span style="color:orangered;">$NULL</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:darkgreen;">#Place mailboxes from the current value of low_bound to the end of the array in $search_list</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:orangered;">$mbxs</span><span style="color:darkgray;">[</span><span style="color:orangered;">$low_bound</span><span style="color:darkgray;">..</span>(<span style="color:orangered;">$mbxs</span><span style="color:darkgray;">.</span>count <span style="color:darkgray;">-</span><span style="color:purple;">1</span>)<span style="color:darkgray;">]</span> <span style="color:darkgray;">|</span> <span style="color:blue;">foreach</span> {</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:darkgray;">[</span><span style="color:teal;">array</span><span style="color:darkgray;">]</span><span style="color:orangered;">$search_list</span><span style="color:darkgray;">=</span><span style="color:orangered;">$search_list</span> <span style="color:darkgray;">+</span> <span style="color:darkgray;">[</span><span style="color:teal;">string</span><span style="color:darkgray;">]</span><span style="color:orangered;">$_</span><span style="color:darkgray;">.</span>UserPrincipalName</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp; }</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp; <span style="color:darkgreen;">#To create an In-Place Hold customize the line below to suit your needs</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp; <span style="color:darkgreen;">#New-MailboxSearch -name $this_search -SourceMailboxes $search_list -InPlaceHoldEnabled $true -ItemHoldPeriod 730</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp; <span style="color:darkgreen;">#To create an ordinary Discovery Search customize the line below to meet your needs</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp; <span style="color:blue;">New-MailboxSearch</span> <span style="color:navy;">-name</span> <span style="color:orangered;">$this_search</span> <span style="color:navy;">-SourceMailboxes</span> <span style="color:orangered;">$search_list</span> <span style="color:navy;">-TargetMailbox</span> <span style="color:orangered;">$DiscoveryList</span><span style="color:darkgray;">[</span><span style="color:orangered;">$DiscoveryLoop</span><span style="color:darkgray;">]</span> <span style="color:navy;">-StartDate</span> <span style="color:darkred;">&quot;12/31/2012&quot;</span> <span style="color:navy;">-SearchQuery</span> <span style="color:darkred;">&quot;&#39;10-K&#39; OR &#39;10K&#39; OR &#39;10k&#39; OR &#39;10k&#39; OR &#39;annual report&#39; OR &#39;fire&#39; NEAR(15) (&#39;insur*&#39; OR &#39;pay*&#39; OR &#39;claim*&#39;) OR &#39;fire&#39; NEAR(20) &#39;insurance&#39;&quot;</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;</span><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp; <span style="color:orangered;">$DiscoveryLoop</span> <span style="color:darkgray;">+=</span> <span style="color:purple;">1</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp; <span style="color:darkblue;">if</span>(<span style="color:orangered;">$DiscoveryLoop</span> <span style="color:darkgray;">-ge</span> <span style="color:orangered;">$DiscoveryCount</span>) {&nbsp; </span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:darkgreen;">#&nbsp;&nbsp; If we have looped through all available Discovery Mailboxes reset the counter&nbsp;<br /><br /></span></span><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:darkgreen;"># to the first element of the array.</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:orangered;">$DiscoveryLoop</span> <span style="color:darkgray;">=</span> <span style="color:purple;">0</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp; }</span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp; <span style="color:orangered;">$low_bound</span> <span style="color:darkgray;">=</span> <span style="color:orangered;">$mailboxesPerSearch</span> <span style="color:darkgray;">*</span> <span style="color:orangered;">$loop_count</span></span></p>
<p><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">&nbsp;&nbsp;&nbsp; <span style="color:orangered;">$MbxRemaining</span> <span style="color:darkgray;">-=</span> <span style="color:orangered;">$mailboxesPerSearch</span></span></p>
<p style="background:white;margin:0cm 0cm 0pt;"><span lang="EN-CA" style="font-family:&#39;Lucida Console&#39;;font-size:9pt;">}</span></p>
<p></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:medium;">If you are using the script above to place mailboxes on In-Place Hold I would suggest that you select a name the will cause the search to appear at the bottom of the list of searches.&nbsp; The reason I suggest this is that the Search placing the mailbox on In-Place hold might be around a long time.&nbsp; Prefixing the name with &ldquo;z&rdquo; or another character further down in the sort order will place all the In-Place Hold searches at the bottom of the list when you sort by name. </span></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><strong><span style="font-family:Calibri;font-size:medium;">Some Discovery Search troubleshooting tips:</span></strong></p>
<ul>
<li><span style="font-family:Calibri;font-size:medium;">Include fewer mailboxes in each search (modify the $mailboxesPerSearch variable in the script)</span></li>
<li><span style="font-family:Calibri;font-size:medium;">Tighten the criteria applied to the get-mailbox cmdlet the script runs to make sure you are only including the mailboxes that truly need to be searched</span></li>
<li><span style="font-family:Calibri;font-size:medium;">Cover a smaller date range in each search.&nbsp; If you searched without a date range and encountered a timeout or other failure read the error message carefully for clues.&nbsp; There have been instances in the past where specifying a start and end date allowed failing queries to complete</span></li>
<li><span style="font-family:Calibri;font-size:medium;">Search during times when demands placed on the search servers are likely to be lower (this will vary by the region in which your mailboxes are hosted)</span></li>
<li><span style="font-family:Calibri;font-size:medium;">Test skipping the &quot;Include unsearchable items&quot; and &quot;enable de-duplication&quot; options.&nbsp; This will reduce the demands of your search and allow it to run faster.&nbsp; If this test works try breaking the search into smaller units and run them individually with the required options.&nbsp; If it still doesn&#39;t work you may need to discuss the search with Office 365 support.</span></li>
<li><span style="font-family:Calibri;font-size:medium;">If you are exporting to PST make sure you have .Net 4.5 and its latest updates installed.</span></li>
</ul>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:medium;">Above I mentioned scheduling your searches as a possible option.&nbsp; If you want or need to run your search during a specific time window it is best to create a scheduled task to execute your PS1 file.&nbsp; The PS1 file then logs on to the Office 365 environment and executes your commands.&nbsp; Here is a sample script that will log on and start a pair of searches:</span></p>
<p><span style="font-family:courier new,courier;font-size:small;"># Specify username and password.&nbsp; The Password is stored in an encrypted text file in this example</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">$EXOAdmUser = &ldquo;<a href="mailto:YourAccount@YourDomain.onmicrosoft.com"><span style="color:#0563c1;">YourAccount@YourDomain.onmicrosoft.com</span></a>&rdquo;&nbsp;</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">$pwd= Get-Content &quot;c:\o365\password.txt&quot; | ConvertTo-SecureString</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">$O365cred = New-Object System.Management.Automation.PSCredential $EXOAdmUser, $pwd</span></p>
<p><span style="font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:courier new,courier;font-size:small;"># Connect to Office 365</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri &quot;<a href="https://ps.outlook.com/powershell/"><span style="color:#0563c1;">https://ps.outlook.com/powershell/</span></a>&quot; -Credential $O365Cred -Authentication Basic -AllowRedirection</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">Import-PSSession $session</span><span style="font-family:courier new,courier;font-size:small;">&nbsp;</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">Start-MailboxSearch -identity &quot;DiscoverySearch1&quot; -force</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">Start-MailboxSearch -identity &ldquo;DiscoverySearch2&rdquo; -force</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">Exit</span></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:medium;">To create password.txt follow these steps:</span></p>
<ul>
<li>
<p><span style="font-size:small;">Log in to office 365 from a PowerShell session using the account that you will be using to create and execute Discovery Searches.&nbsp; You can use these lines to do so:</span><br /><span style="font-size:small;"> $O365Cred = (Get-Credential)</span><br /><span style="font-size:small;"> $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri &quot;<a href="https://ps.outlook.com/powershell/">https://ps.outlook.com/powershell/</a>&quot; -Credential $O365Cred -Authentication Basic -AllowRedirection</span><br /><span style="font-size:small;"> Import-PSSession $session</span></p>
</li>
<li>
<p><span style="font-size:small;">Run this command:&nbsp; $o365cred.Password | ConvertFrom-SecureString | Set-Content c:\o365\password.txt</span></p>
</li>
<li>
<p><span style="font-size:small;">Make sure password.txt is created.</span></p>
</li>
</ul>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-size:medium;"><span style="font-family:Calibri;">To log in at the time you wish and start your script you would need to create a Scheduled Task.&nbsp; In Scheduled Tasks you would use a command line like </span>powershell.exe -Noninteractive -Noprofile -Command &ldquo;&amp;{&lt;full path to your script&gt;}&rdquo;.</span></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p></p>]]></content:encoded>
    </item>
    <item>
      <title>How to run SDP on a computer that cannot connect to the Internet</title>
      <link>https://docs.microsoft.com/archive/blogs/chris_pollitt/how-to-run-sdp-on-a-computer-that-cannot-connect-to-the-internet</link>
      <pubDate>Tue, 12 Feb 2013 12:29:00 GMT</pubDate>
      <dc:creator><![CDATA[chrispol]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chris_pollitt/2013/02/12/how-to-run-sdp-on-a-computer-that-cannot-connect-to-the-internet/</guid>
      <description><![CDATA[In support we frequently ask that customers run the Support Diagnostics Platform so we can collect a...]]></description>
      <content:encoded><![CDATA[<p>In support we frequently ask that customers run the Support Diagnostics Platform so we can collect a wide range of basic data on a particular server or client.&nbsp; The catch is that not all servers or clients are able to connect to the internet.&nbsp; If the machine that is to run the tool cannot connect then you have to run it on a machine that does have access.&nbsp; This blog contains screen shots of the steps you need to go through.</p>
<p>&nbsp;</p>
<p>Start by following the link you were sent to the web page.&nbsp; After this follow these screen shots:</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/64/1351.first%20screen.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-64/1351.first-screen.PNG"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/64/1351.first%20screen.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-64/1351.first-screen.PNG" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>Say Yes to the User Account Control Prompt.</p>
<p>&nbsp;</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/64/6786.2ndscreen.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-64/6786.2ndscreen.PNG"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/64/6786.2ndscreen.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-64/6786.2ndscreen.PNG" alt="" border="0" /></a></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/64/0044.3rdscreen.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-64/0044.3rdscreen.PNG"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/64/0044.3rdscreen.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-64/0044.3rdscreen.PNG" alt="" border="0" /></a></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/64/8510.4thscreen.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-64/8510.4thscreen.PNG"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/64/8510.4thscreen.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-64/8510.4thscreen.PNG" alt="" border="0" /></a></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/64/3782.5thscreen.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-64/3782.5thscreen.PNG"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/64/3782.5thscreen.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-64/3782.5thscreen.PNG" alt="" border="0" /></a></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/64/0640.6thscreen.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-64/0640.6thscreen.PNG"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/64/0640.6thscreen.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-64/0640.6thscreen.PNG" alt="" border="0" /></a></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/64/5327.7thscreen.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-64/5327.7thscreen.PNG"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/64/5327.7thscreen.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-64/5327.7thscreen.PNG" alt="" border="0" /></a></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/64/8055.8thscreen.PNG" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-64/8055.8thscreen.PNG"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/87/64/8055.8thscreen.PNG" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-87-64/8055.8thscreen.PNG" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;At some point in the future I might expand this to include the steps on the Exchange server.&nbsp; However for the moment I will end here.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>12800 Event solutions</title>
      <link>https://docs.microsoft.com/archive/blogs/chris_pollitt/12800-event-solutions</link>
      <pubDate>Wed, 14 Mar 2012 21:02:00 GMT</pubDate>
      <dc:creator><![CDATA[chrispol]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chris_pollitt/2012/03/14/12800-event-solutions/</guid>
      <description><![CDATA[12800 events indicate you are running out of memory.&nbsp; For example:
Event Type: Error Event...]]></description>
      <content:encoded><![CDATA[<p>12800 events indicate you are running out of memory.&nbsp; For example:</p>
<p>Event Type: Error <br />Event Source: MSExchangeIS <br />Event Category: Content Engine&nbsp; <br />Event ID: 12800 <br />Date: 1/27/2012 <br />Time: 9:47:14 AM <br />User: N/A <br />Computer:&nbsp;Contoso1 <br />Description: <br />Message processing failed because there is not enough available memory (8007000E-80000000).&nbsp;</p>
<p>&nbsp;</p>
<p>There are three basic courses that troubleshooting can follow here:</p>
<ul>
<li>Check for 9582 events.&nbsp; If you have them start with these:&nbsp; Collect performance data, make sure the updates from KB article&nbsp;<a href="https://support.microsoft.com/kb/960144">https://support.microsoft.com/kb/960144</a> are applied, and follow the steps in <a href="https://support.microsoft.com/kb/325044">https://support.microsoft.com/kb/325044</a></li>
<li>If there are no 9582 events in your application log turn up Diagnostic logging on MSExchangeIS\Content Engine (this should generate 9684 events for bad calendar items)</li>
<li>Use the CalCheck tool described in this blog:&nbsp; <a href="https://blogs.technet.com/b/exchange/archive/2012/02/22/calcheck-the-outlook-calendar-checking-tool.aspx">https://blogs.technet.com/b/exchange/archive/2012/02/22/calcheck-the-outlook-calendar-checking-tool.aspx</a></li>
</ul>
<p>&nbsp;</p>
<p>The CalCheck tool has resolved a couple of these cases for me since it was released.&nbsp; In these cases bad calendar items were blowing right through the limits that Exchange had imposed upon their conversion.&nbsp; The conversion engine had only allocated a fixed amount of RAM and these items required more.&nbsp; This caused&nbsp;the Out of Memory error to be reported.&nbsp; When CalCheck examined these items it flagged them.&nbsp; When the Administrator deleted them the 12800 events disappeared from the application logs of the Exchange Server.</p>
<p>&nbsp;</p>
<p>Hopefully Randy's CalCheck tool will be equally effective for you if your server is encountering this event.&nbsp; The tool should be good for locating bad calendar items whether you have the 9582 events or not.&nbsp; In fact, once the bad calendar items are cleared out, it <span style="text-decoration: underline;">may</span> lessen the 9582 events.&nbsp; Just be careful not to assume that it will lessen or stop them.&nbsp; The abbreviated steps I provided in the first bullet point are still your best bet if you are seeing 9582s.</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Dumping Cluster logs in response to an event</title>
      <link>https://docs.microsoft.com/archive/blogs/chris_pollitt/dumping-cluster-logs-in-response-to-an-event</link>
      <pubDate>Wed, 29 Feb 2012 18:10:35 GMT</pubDate>
      <dc:creator><![CDATA[chrispol]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chris_pollitt/2012/02/29/dumping-cluster-logs-in-response-to-an-event/</guid>
      <description><![CDATA[Recently I was working with a customer that experienced&nbsp;database moves&nbsp;in their DAG.&nbsp;...]]></description>
      <content:encoded><![CDATA[<p>Recently I was working with a customer that experienced&nbsp;database moves&nbsp;in their DAG.&nbsp; The "failovers" were always at odd hours when there were no admins available.&nbsp; By the time the admins came in and tried to dump the cluster logs the data was gone.&nbsp; (Basically the cluster logs are spread across three files.&nbsp; Each of those files operates in a circular fashion. &nbsp;This is explained by Jeff Hughes in greater detail here:&nbsp; <a href="https://blogs.technet.com/b/askcore/archive/2010/04/13/understanding-the-cluster-debug-log-in-2008.aspx">https://blogs.technet.com/b/askcore/archive/2010/04/13/understanding-the-cluster-debug-log-in-2008.aspx)</a>.&nbsp; In this customer's case the logs were overwriting within about 90 minutes.&nbsp;</p>
<p>I suggested increasing the size of the customer's cluster log, but to get the 72 hours Jeff recommends their cluster log was going to need to be huge.&nbsp; We needed an alternative that would cover them if there was a problem on Friday night that nobody picked up until Monday morning.</p>
<p>The suggestion I gave them was simply to use the Windows 2008 Task Scheduler to generate their cluster logs.&nbsp; Based on their scenario the last event in the sequence before the server began restarting services was Event ID 2137 from MSExchangeRepl.&nbsp; Within Task Scheduler we followed these steps:</p>
<ul>
<li>Under Actions select Create Task</li>
<li>Go to the Triggers tab and click New</li>
<li>Change the Begin the Task selection to "On an event"</li>
<li>We used Basic, selected the Application log, our source and the event ID</li>
<li>We then chose to delay the task for 5 minutes (long enough for the services to restart)&nbsp;and clicked OK</li>
<li>Go to the Actions tab and select New</li>
<li>We chose to place our command to generate the cluster log (complete with all parameters) in a BAT file, so we specified that BAT file as the program to run and clicked OK.&nbsp; For details on how to generate the cluster log please see this blog:&nbsp; <a href="https://blogs.msdn.com/b/clustering/archive/2008/09/24/8962934.aspx">https://blogs.msdn.com/b/clustering/archive/2008/09/24/8962934.aspx</a></li>
<li>On the General tab we gave our task a name and description</li>
<li>We also selected "Run whether the user is logged on or not"</li>
</ul>
<p>We left the task to run overnight and it successfully captured the cluster log for us.&nbsp; The only real challenge for us was selecting an event that was consistently associated with their failure so that we would not miss our opportunity by generating a spurious log.&nbsp; The MSExchangeRepl event worked well in this instance because it was unique.&nbsp; I might have preferred using a 7031 from the System log, but the Task does not offer a chance to filter by the text in the description.&nbsp; Therefore the 7031 event would not be unique and we might capture the wrong service failure.</p>
<p>Later we were able to agree on an increased size for their cluster log, but when I last spoke to them they were setting up the task just in case they overran their cluster log and an admin didn't respond to their alerts in time.</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>OWAEnabled filter returns unexpected results</title>
      <link>https://docs.microsoft.com/archive/blogs/chris_pollitt/owaenabled-filter-returns-unexpected-results</link>
      <pubDate>Fri, 30 Sep 2011 11:46:19 GMT</pubDate>
      <dc:creator><![CDATA[chrispol]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chris_pollitt/2011/09/30/owaenabled-filter-returns-unexpected-results/</guid>
      <description><![CDATA[I recently had a customer that was running:
get-casmailbox -filter {OWAEnabled -eq $false}
In the...]]></description>
      <content:encoded><![CDATA[<p>I recently had a customer that was running:</p>
<p>get-casmailbox -filter {OWAEnabled -eq $false}</p>
<p>In the output they saw numerous rows displayed where OWAEnabled was actually listed as $true.</p>
<p>&nbsp;</p>
<p>They found that if they run the command below they get the correct result:</p>
<p>get-casmailbox | where-object {$_.owaenabled -eq $false}</p>
<p>&nbsp;</p>
<p>So why the difference?&nbsp; The OWAEnabled property is not actually assigned a default value.&nbsp; When the get-casmailbox cmdlet is run it treats Not Set as $true when it displays the data.&nbsp; The filter is returning everything that is False and that has not been set previously.</p>
<p>So how do you always get accurate results from the filter?&nbsp; The only ways&nbsp;are to:</p>
<ul>
<li>explicitly define the value of OWAEnabled with the creation of each mailbox (easy to do if you use provisioning scripts, an extra manual step if you use the GUI)</li>
<li>Run this command:<br />get-casmailbox | where-object {$_.owaenabled -ne $false} | set-casmailbox -owaenabled $true<br />This command will produce warnings for every user it touches, but does not need to change because the user has already been set to $true.</li>
</ul>
<p>&nbsp;</p>
<p>Hopefully this helps everyone get accurate results back from this cmdlet.&nbsp; Have a good weekend!</p>]]></content:encoded>
    </item>
    <item>
      <title>How high item counts can influence 623 events</title>
      <link>https://docs.microsoft.com/archive/blogs/chris_pollitt/how-high-item-counts-can-influence-623-events</link>
      <pubDate>Wed, 31 Aug 2011 08:25:43 GMT</pubDate>
      <dc:creator><![CDATA[chrispol]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/chris_pollitt/2011/08/31/how-high-item-counts-can-influence-623-events/</guid>
      <description><![CDATA[In my earlier blog about 623 events I mentioned there are a great many possible causes.&nbsp; Twice...]]></description>
      <content:encoded><![CDATA[<p>In my earlier blog about 623 events I mentioned there are a great many possible causes.&nbsp; Twice in the last 1.5 months I have seen a situation where high item counts were the major contributing factor for 623 events.</p>
<p>In both cases the dumps were collected and they revealed that the store was busy working on an "empty" search.&nbsp; What this means is that the store was working with the internal MAPI Search Folders that had been constructed for a folder that had too many items in it.</p>
<p>With Exchange 2010 the architecture has changed, but in Exchange 2007 and lower the store creates and maintains numerous MAPI Search Folders on each folder (also known as Restricted Search Views as outlined in this article https://technet.microsoft.com/en-us/library/cc535025(EXCHG.80).aspx).&nbsp; There is a cap on the number, but until that cap is reached every unique Search or Sort that is done on the folder is tracked.&nbsp; The resulting MAPI Search Folder is then updated with every change to the folder.&nbsp; Typically the store maintains 3-5 MAPI Search Folders per folder, but if you are in Outlook (online mode) and change the Sort order to one Exchange did not already have built then Exchange will build a new MAPI Search Folder.&nbsp; The database engine will then maintain that MAPI Search Folder until it expires (typically 40 days).</p>
<p>So you're probably thinking - Why is this bad?&nbsp; Aren&rsquo;t these just indexes?&nbsp; That is what databases do.</p>
<p>Even if these were just indexes you would only be partially correct.&nbsp; The issue comes in the number of MAPI Search Folders the database engine can end up maintaining and the resources it consumes to constantly update them.&nbsp; Most databases do not dynamically create and destroy indexes.&nbsp; If your IT staff or developers make you a SQL database they will optimize the indexes to give the greatest possible speed to the forms and queries that will be commonly used.&nbsp; This allows them to account for performance considerations at design time.&nbsp; Exchange and Outlook are creating most of these MAPI Search Folders on the fly.&nbsp; This makes it impossible to foresee all performance scenarios.&nbsp; In addition to this the Search Folder is more than an index.&nbsp; It is actually a separate table that is linked back to the original.&nbsp; Thinking of the MAPI Search Folders as an index is too much of a simplification.</p>
<p>When a new item is added to a folder and the Store begins updating the MAPI Search Folders those updates all go into a single transaction.&nbsp; If there are 30 MAPI Search Folders to update then all of the pages that will be dirtied get loaded into the Exchange Version Store as part of a single transaction.&nbsp; That causes the consumption of Version Buckets to rise (as seen in the counter "\Database(Information store)\Version buckets allocated" ).&nbsp; The number of items influences how long it takes to traverse each MAPI Search Folder and carry out all the proper page splits, writes, etc. for the update.&nbsp; If there are a lot of MAPI Search Folders that are very large they will each take longer to load, examine, and update.&nbsp; Therefore pages in the Version Store will be held longer.&nbsp; The longer those pages are held the greater the chance we will have a 623 event occur.</p>
<p>Now if this is just one mailbox that is over by a little bit this probably won't hurt and won't cause a problem.&nbsp; However, if you have numerous mailboxes with high item counts and the users are active in the folders with the higher counts, then the cumulative effect can snowball into a 623 event.</p>
<p>By default Exchange only maintains a maximum of 11 Restricted Search Views per folder and updates each for 40 days (after which, if it hasn't been used in 40 days, it is removed).&nbsp; However if an online mode client has multiple regional settings this can turn into one set of 11 per language.&nbsp; Also Administrators can raise the number from 11 to whatever they like (a max of 50 is recommended in https://technet.microsoft.com/en-us/library/cc535025(EXCHG.80).aspx).&nbsp; Raising the number from 11 can be desirable because you can prevent dynamically created Views from being bumped out of the list and replaced by more recently requested views (if users are constantly causing turnover between views it can cause other performance problems).</p>
<p>You can get short term relief from running Outlook /cleanviews.&nbsp; However, because the views are created dynamically you can very quickly return to the problem.&nbsp; In the relatively rare case where this problem is occurring it would be better to reduce item counts to avoid the problem.&nbsp; You can check item counts with the steps outlined in this blog:&nbsp; &nbsp;<a href="https://blogs.technet.com/b/exchange/archive/2009/12/07/3408973.aspx">https://blogs.technet.com/b/exchange/archive/2009/12/07/3408973.aspx</a></p>
<p><a href="https://blogs.technet.com/b/exchange/archive/2009/12/07/3408973.aspx"></a></p>]]></content:encoded>
    </item>
  </channel>
</rss>