Monday 27 April 2020

Enable incoming mails in SharePoint Online

In SharePoint 2010, 2013 and 2016, When incoming emails are enabled, SharePoint sites can receive and store email messages and attachments in lists and libraries. And this Incoming email feature is available only in SharePoint Server 2016 and earlier versions of SharePoint Server, and this has been deprecated as of SharePoint Server 2019 and SharePoint Online. 

Alternate Solution: 

SharePoint Online does not have email enabled lists like on-prem SharePoint has. We have to use a work around using other Office 365 apps to create a similar functionality. A Office 365 email address has to be added to the To or CC line so the email can be sent to the Office 365 mailbox. The email will be filtered to a sub folder based on certain criteria (e.g. sender). We then use Microsoft Flow to grab the attachment(s) and move them to the desired folder on your SharePoint Online site. 

Microsoft Flow:

We can make use of Power Automate(Flow) to create a simple flow which will read mails from a Shared Mailbox in Exchange Online, get the attached documents and upload those in the SharePoint Online document library. 

Shared Mailbox vs User mailbox: 

Shared Mailbox accounts:
  • Shared mailbox do not require O365 license.
  • These accounts are disabled by default and not designed for direct logon into AD/Azure with no license but mailbox-enabled.
  • This account will not get resolved in SharePoint.

Note: If you are using SharePoint Designer workflow: Check if your workflow was created using 2013 template, If so, please create the same workflow in 2010 template and verify the logic. You will not be able to send an email to Shared mail box account using SPD 2013 template.

User mailbox accounts:
  • We can call it as non-human id mailbox accounts.
  • User mailbox enabled and designed for direct logon into AD/Azure and We should be able to resolve these accounts in SharePoint so that we can grant them access. 

Create a Shared Mailbox: 
  • Create a mail enabled shared mailbox in Office 365 if you have exchange administrator(or Global) permissions if not get it done by exchange administrators.

Reset Password:
Reset password from Office 365 Admin Portal-->Active Users. 

Create Flow:
Now that we have the required mailbox and it’s password in place, lets go ahead and create our flow. 

Go to Microsoft Flow and login with your Office 365 account. This account need not be the same mailbox account.
Click on My flows and then on Create from blank template
Select flow trigger ‘When a new email arrives’ and then create the flow.

Once the connection is added, we need to configure which folder to look into the incoming mails. So, click on the folder icon next to the text box with screen tip as “mail folder to check for new emails” and select Inbox from the menu. You may also want to select Attachment and Include Attachment to Yes to ensure this flow only triggers when the incoming mail has any attached documents.


So now the source is set. Let’s configure SharePoint part. 

Click on New Step, and type ‘Get Email’ from search box. 

Click on Message Id box,  then click on second box (add dynamic content), under dynamic content tab in search box type Message Id which you want to map , then select your column under "When a new Email arrives" section.

Select Include Attachments should be Yes

Click on ‘New Step’, and select ‘Create File’ from search box

Select the Site URL either from drop down or just by typing it in the site URL in Site Address and then the document library in the Folder Path field and click Save Now. 

Click on File Name box,  then click on second box (add dynamic content), under dynamic content tab in search box type ‘attachments name’ which you want to map , then select your column under "Get email" section.

Click on File Content box,  then click on second box (add dynamic content), under dynamic content tab in search box type ‘attachments content’ which you want to map , then select your column under "Get email" section.

Finally add Delete Email action to delete the email from the Office 365 mailbox. 

Click on ‘Add an action’ and select ‘Delete Email ’ action. From the second box (add dynamic content), under dynamic content tab in search box type ‘Message Id’ which you want to map , then select your column under “Get email’ section.

Your Flow should be like this


Saturday 25 April 2020

Degraded search Index partition in SharePoint

Error: "Search has encountered a problem that prevents results from being returned. If the issue persists, please contact your administrator."

For further investigation please run the below command using PowerShell as Administrator.

$ssa = Get-SPServiceApplication Get-SPEnterpriseSearchStatus -SearchApplication $ssa -Detailed -Text

After execution, the result confirmed a problem with the Index Partition, showing the Index component with the Degraded state.

Collect Logs:
get-sploglevel | where {$_.Area -like "*Search*"} | Set-SPLogLevel -TraceSeverity VerboseEx

Run Clear-SPLoglevel on your search farm and recreate the same issue and then gather the latest 2 ULS logs from each server in the search topology from the Search farm and then review the logs.

Here are plans to fix the issue: 

Plan-1:
Reboot the index server(03). If the components are not up then look for Plan-2

Plan-2:
Restart SharePoint Search Host Controller Service in all the server in search farm – this should fix the issue in most of the cases.

Plan -3:
Clear SharePoint cache in all the SharePoint search servers in the farm and then restart search services.

Plan-4:
Resent index and start full crawl.

If the index component issue did not fixed OR If the Index component keeps getting degraded and after every 10-15 minutes or so and then it recovers then proceed with the last plan.

Plan 5: If the index component status is intermittent failure then this will interfere with the sync process on other index server(04).

  • Login to the degraded status index server 03 server
  • Stop SharePoint Search Host Controller Service
  • Stop timer service
  • Delete these 3 folders (indexmeta, journel, ms) in two partitions under the path below. I:\indexinternal\Index0\SP1e52c35718bb.1.I.1.0 I:\indexinternal\Index1\SP1e52c35718bb.1.I.1.0

  • Login to 04 server
  • Stop host controller
  • Stop timer service
  • Delete these 3 folders (index meta, journal, ms) under the path below.
  •       I:\index\Index0\SP1e52c35718bb.1.I.1.0
  •       I:\index\Index1\SP1e52c35718bb.1.I.1.0
  • Start search host controller and timer service on both 03 &04
  • the 3 folders are provision on the path above on Index 0 & 1
  • we can see the folders then we go to UI and do the Index Reset
  • Start the full crawl on a content source and we can see success crawl log 
  • All the search components are should in healthy status.