Category: Rants


Been ages since I blogged, but would like to share FCPakistan.com – which to my knowledge is Pakistan’s first SharePoint 2010 WCM site. So what is it?

Food Connection Pakistan (Pvt.) Ltd, Pakistan’s Premiere Food Guide. A Brilliant Platform where Food Industry Gets their due recognition. Food Businesses Thrive, while consumers have the time of their Life. Search Eateries by Hot Deals, Price, Cuisine, Location, Specialty & Facilities.

Visit www.fcpakistan.com today, for the first 3 months the FCPK team are giving away Rs. 500 vouchers to new members, best of all membership is free!

A couple of months back started  Maventor to focus on Training and Mentoring activities around SharePoint 2010 and Office 2010 and it’s kept me really busy, here is my schedule for the next few months. I encourage the readers to attend the executive briefs or one of the courses.

SharePoint 2010 Hands On Days come to Australia! Train with a Microsoft Certified Master and other MCTs to start building with and deploying SharePoint 2010. Hands On Day’s offer SharePoint 2010 focused and accelerated ‘hands on’ learning for Australian Developers and IT Professionals.

Learn more and register at www.handsonday.com

I only get a chance to setup email enabled libraries once every 4 months or so. My last setup was a couple of weeks back. This was for one of our customer who wanted to use incoming email functionality to support some reports coming from external sources; this particular customer was running Microsoft Exchange 2007.

Before I get into the actual steps, here are some basics: For email enabled libraries to work in SharePoint, you need at least one server in your SharePoint Farm to host the SMTP service (on Windows 2008 and above this service is still administrated through IIS 6.0 Manager) this service stores routed email in a drop folder from where SharePoint timer job picks it up periodically and puts it in the document library linked to an email alias (the LibName part in LibName@companyname.com). The timer jobs run on all severs connected to the Farm but only the server where the mail is forwarded to will actually process it. When Distributed Lists management is turned on SharePoint will create Contacts for all incoming email library under the selected organisational unit.

Here are some quick sanitised steps that I documented for the customer:

  1. Create an Organisational Unit under you domain called SPMail, for example the one I created has an LDAP Path: OU= SPMail,OU=Melbourne,DC=COMPANYNAME,DC=COM
    1. On Windows Server 2008 and above ADSI Edit is preinstalled and one of best tool to find the LDAP Paths
  2. On the newly created OU setup Delegate rights with Full Control for the Central Administration\Timer Service Account: DOMAIN\ServiceAccountName
    1. Full Control is not Necessary, you can get by Read, Write
  3. On your DNS Server add a new MX record, to a new subdomain like SPMAIL such that your entry looks like SPMAIL.COMPANYNAME.COM with Mail Server Priority set to 20 and DNS pointing to the SharePoint box (for example SPAPP.COMPANYNAME.COM) in your farm with the SMTP service running locally.
  4. Open up Exchange 2007 Management console and under Hub Transport create a new Send Connector called SharePoint Mail
    1. Use the following for the Address Space value: SPMAIL.COMPANYNAME.COM
    2. Under Smart Host Routing setting select: Use DNS for MX Records
  5. Install and setup the SMTP service on SPAPP.COMPANYNAME.COM for domain: SPMAIL.COMPANYNAME.COM with the drop folder set to its default value
  6. Finally setup the Incoming Email settings under operations in Central Administration (<CA SITE>/_admin/IncomingEmail.aspx)

For testing simply enable email on Shared Document library under the Central Admin Site. This can be done by going to list settings and the clicking on the Incoming Email Settings link.

Library: <CA SITE>/Shared%20Documents/Forms/AllItems.aspx

Email Alias: SharedDocuments@SPMAIL.COMPANYNAME.COM

Verify that a new Contact is created in AD and Exchange and then send an email using you email client to verify if emails are being routed to the library.

Had this question pop up at work today, to show all items without folders in SharePoint you will need to add the Recursive attribute to the SPQuery object.

 Here is an example, This can be done in Code:

 SPQuery.ViewAttributes += ” Scope=\”Recursive\””;

 Or as part of the CAML Query Markup

    <FieldRef Name=’ID’ /> 

</ViewFields> 

<QueryOptions> 

   <ViewAttributes Scope=’Recursive’ /> 

   <OptimizeFor>FolderUrls</OptimizeFor> 

</QueryOptions>

Other query options are:

<QueryOptions>
   <IncludeMandatoryColumns>True</IncludeMandatoryColumns>
   <DateInUtc>True</DateInUtc>
   <IncludeAttachmentUrls>True</IncludeAttachmentUrls>
   <IncludePermissions>True</IncludePermissions>
   <ExpandUserField>True</ExpandUserField>
   <Folder>Name Of the Folder Here/</Folder>
</QueryOptions>