Thursday, October 28, 2010

SharePoint 2010 Email Enabled Document Library

I have been working with SharePoint for nine years and love it. Amazingly, I finally had a reason to use the SharePoint e-mailed enabled library, which I have wanted to learn since 2007.

So here’s the scenario. We use a SaaS timesheet application to record time for our employees. We wanted to import that daily report into SharePoint and display the data in a page along with other daily metrics. This report could be sent in Excel, HTML and CSV format. I also decided to use SSIS to import the data into SQL to populate a Performance Point Dashboard. Easy right?
Well, the SaaS application is only able to email reports to us and have no future plans to provide web services to query the data. Oh well. So we setup the reports to be emailed to ourselves and scheduled delivery as daily. Now, since our email server is 2003 SBS Exchange, there was little that could be done to re-reroute the emails.

After a number of searches on Google I found Jeff Widmer’s Blog with a part of the solution: http://weblogs.asp.net/jeffwids/archive/2010/08/16/configuring-incoming-email-for-sharepoint-2010-foundations.aspx . However I only wanted to use an internal account and did not want to expose the STMP server to the web.

So, here’s how we handled it.

1 – Setup the SharePoint SMTP
Login to Central Administration for either Foundation or SharePoint 2010 portal. Choose System Settings > Configure Incoming Email.


Now since I had already setup the outgoing email settings to use the SMTP server on my SharePoint server, I decided to use that for the incoming email as well. For more information on setting up the outgoing SharePoint E-mail click here, http://technet.microsoft.com/en-us/library/cc263462.aspx.

Be sure and remember the Domain Name you used to setup the SharePoint SMTP server because you will need this when you setup the Incoming E-mail settings.






Clicking on the Configure Incoming E-mail link will display this page. -->

Use the SharePoint server name + domain name + .local (ie. SharePoint.Company.local). Put that in the Incoming Email Address field.

You will also want to select Yes for Enable Sites on this server to retrieve email?

2- Setup the Document Library
Now, find the document library you want to email your attachments to and under Library Settings, click Incoming e-mail settings under Communications.


Click “Yes” under Allow this document library to receive e-mail? Under E-mail Address field add the address you want to use for this library.

Since I want this to update daily, I chose: Save all attachments in root folder and Overwrite files with same name to “Yes”.






3 –Test the Library
To test this out, open your email client and send a message with an attachment.

After a few secs, the email attachment is now in the document library:

So, I will add the SSIS import in my next post. Happy Coding!

Saturday, August 28, 2010

Increasing SharePoint 2010 List Maximum

I have been developing on SharePoint since 2001 and it is beginning to amaze me that "mystery errors" remain. Ok, so recently I was setting up a SharePoint 2010 custom list pulling data from Bugtracker using the data connector. When I opened the page, I got the "unable to ... blah, blah" - mystery error. Anyway, I searched in Google, Bing, Yahoo...and nothing. Then after digging around in Google Groups, I found an interesting lead.

"Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator. "


Buried in the log
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS

The maximum number of rows that can be read through Database Connector is '2000'. The limit can be changed via the 'Set-SPBusinessDataCatalogThrottleConfig' cmdlet.

Below is the script I needed to run in Powershell to increase the maximum limit. This allowed my 2500 bugs list from Bugtracker to be displayed. When the CEO is happy, I'm happy. Happy Coding.

Set-SPBusinessDataCatalogThrottleConfig
$proxy = Get-SPServiceApplicationProxy where {$ -match “Business Data Connectivity Service”}
Get-SPBusinessDataCatalogThrottleConfig –Scope database –ThrottleType items –ServiceApplicationProxy $proxy

$defaultThrottleConfig = Get-SPBusinessDataCatalogThrottleConfig –Scope database –ThrottleType items –ServiceApplicationProxy $proxy
$defaultThrottleConfig

Set-SPBusinessDataCatalogThrottleConfig –Default 10000 –Identity $defaultThrottleConfig –Maximum 20000
$customThrottleConfig = Get-SPBusinessDataCatalogThrottleConfig –Scope database –ThrottleType items –ServiceApplicationProxy $proxy
$customThrottleConfig

Monday, June 28, 2010

Welcome

This space will contain various code, scripts, how-to and documents I write as I walk through this life. Feel free to share.