Archive

Posts Tagged ‘sp2010’

SharePoint 2010: Configuring incoming emails on a Production Environment (non-Exchange Server)

September 17, 2012 1 comment

Recently I needed to setup incoming emails on a SharePoint 2010 site sadly, after researching this subject a lot, I was not able to find a blog that provided a complete answer of how to set this up on a Production Environment. There are some variations in the way this can be setup but the method I will be explaining in this blog involves a non-Exchange Server method.

Assumptions

I am assuming that:

  • You have setup an SMTP server on one of your SharePoint WFE’s (Web Front End) if you are not sure on how to do this then please check out this post.
  • You have a domain name registered and that you can modify the DNS records

The Solution

The solution involves:

  • Setting up the DNS Records
  • Configuring the SMTP Server
  • Configuring Central Administration
  • Configuring a SharePoint List

Setting up the DNS Records

In this example I am using a domain name: http://www.shareheaven.co.uk that is registered with GoDaddy.com.

Login to your domain name’s control panel and add a DNS A (Host) record in the following format:

Setting up a DNS A (Host) Record

Where the host (‘notify’ in this example) can be anything of your liking. The IP address should be the IP address of the server that hosts the SMTP Server.

Next we need to add a DNS MX Record in the following format:

Setting up the MX Record

Wait for the DNS changes to take effect, you can use this website to check if the changes have taken effect.

Configuring the SMTP Server

On the SMTP Server we will need to add an alias. Open IIS 6.0 Manager > Expand your SMTP Server in the list on the left hand side > Right click on ‘Domains’ > New > Domains.

SMTP Alias Setup

On this screen (screen shot above) select Alias and click Next and then fill it out as below (based on your domain name):

Creating an alias

Configuring Central Administration

Next we need to setup Central Administration to enable incoming emails in our SharePoint Farm, in Central Admin browse to System Settings > Configure incoming e-mail settings and set it up as below:

Central Administration Setup

Configuring a SharePoint List

Finally, we can now setup a SharePoint List to receive incoming emails. In this example I will be setting up a Document Library to receive incoming emails. Browse to Library Settings > Incoming e-mail settings of the SharePoint List you would like to setup to receive incoming emails. Fill out the form as below and click ‘OK’:

Configure the SharePoint List

Testing the Solution

To test the solution send an email to the email address we setup to receieve incoming emails which in our example was: test@shareheaven.co.uk (replace shareheaven with your domain name of course!):

Sending the email

Screen shot below shows the .eml file arriving in the drop folder of the SMTP Server:

Mail drop folder

A SharePoint Timer Job picks up this email, processes it and then adds an item in the Document Library:

Document Library Item Added

Advertisements

Archiving documents in SharePoint 2010 OTB

September 13, 2012 1 comment

There might be other ways of setting this up but I thought I should write about a way of achieving this by purely utilising SharePoint 2010 out-of-the-box features.

Scenario

You have a document library, we will call it Documents, that has a custom Content Type (we will call it ER Documents). Based on a certain criteria, lets say 6 months after a document has been approved, you would like to archive the document by moving it to another document library called ‘ER Compliance Archived Documents’.

Assumptions

You have two identical document libraries setup with the same content type enabled.

The Solution

The solution involves:

  • Enabling the Content Organizer Feature
  • Creating a Content Organizer Rule
  • Configuring a ‘send to’ connection
  • Configuring the Document Library

Enabling the Content Organizer Feature

On the root web of your Site Collection browse to Site Actions > Site Settings > Manage Site Features and activate the ‘Content Organizer’ Feature.

After this feature is activated you will notice two new options in Site Settings (highlighted in the screenshot below) and a new document library called ‘Drop Off Library’:

Content Organizor Options

Click on ‘Content Organizer Settings’ and make a note of the Web Service URL:

Web Service URL

Creating a Content Organizer Rule

Click on the ‘Content Organizer Rules’ link and add a new item to create a new rule and set it up as below (click on the image if it appears a bit blurred):

Content organizer rule

This rule basically specifies where and how to route the archived documents.

Configuring a ‘send to’ connection

Browse to Central Administration > General Application Settings > Configure send to connections. Select the correct Web Application and create a new send to connection by filling out the form as below pasting the Web Service URL you copied earlier:

Send To Connection

Click on ‘Add Connection’ and then ‘OK’.

Configuring the Document Library

Browse to the main ‘Documents’ document library > Library Settings > Information management policy settings > ER Documents (this is our content type) > Check ‘Enable Retention’ and fill the form out as below:

Enable Retention

Testing the solution

Add a document that matches the archiving criteria (i.e. Approval Date more than 6 months ago).

Go to Central Administration > Monitoring > Review job definitions > select your Web Application and manually run the ‘Information management policy’ timer job. This job process and marks the documents, that match the criteria we have setup, for transfer. After the job has completed manually run the ‘Expiration policy’ timer job this timer job does the actual transfer of the marked documents.

After this the relevant documents that match the Information management policy criteria will be moved to the archived library.

You can also test this manually by browsing to the ‘Documents’ document library> Accessing the context menu > Send to > ER Compliance Archive (screenshot below).

Manually archive document

The document should then appear in the archive document library. Please note that the manual send to method moves the document immediately but it is a useful way of testing whether you have configured the routing correctly.

SharePoint 2010 FBA: Enable search by part or full name in People Picker

March 18, 2012 4 comments

 
Please refer to this post of mine on how to configure Forms Based Authentication (FBA) on a SharePoint Web Application using ASP.NET SQL Membership Provider.

After you setup FBA the People Picker control by default will only search for user’s by using the username. However, if you would like to search for users by part or full display name then you will need to carry out the following changes to the Membership Database:

  • Add a column “ProfileNames” of type nvarchar(255) in the table: aspnet_Users
  • Update the stored procedure: aspnet_Membership_FindUsersByName by replacing the following where clause:
    WHERE  u.ApplicationId = @ApplicationId AND m.UserId = u.UserId AND u.LoweredUserName LIKE LOWER(@UserNameToMatch) 
    

    with:
     

    WHERE  u.ApplicationId = @ApplicationId AND m.UserId = u.UserId AND u.ProfileNames LIKE '%' + LOWER(@UserNameToMatch) + '%'
    
  • Create the following Trigger on the “aspnet_Profile” table:
    CREATE TRIGGER [dbo].[ProfileProperty_Trigger] 
       ON   [dbo].[aspnet_Profile] 
       AFTER INSERT,UPDATE
    AS 
    BEGIN
    SET NOCOUNT ON;
    DECLARE @Names nvarchar(50)
    DECLARE @UID nvarchar(50)
    
    SELECT 
    @Names = p.PropertyValuesString,
    @UID = p.UserId
    FROM aspnet_Profile p
    INNER JOIN inserted i
    ON p.UserId = i.UserId
    
    UPDATE aspnet_Users SET ProfileNames = @Names WHERE aspnet_Users.UserId = @UID
    END
    
    •  
      That is it, after making these changes the People Picker control should now match by username as well as display name.

0x80070057 Invalid data has been used to update the list item. The field you are trying to update may be read only.

March 22, 2011 2 comments

I came across this strange error today when I was trying to (programmatically) update a lookup column in a SharePoint list.

Below is the declaration for the lookup column in the schema.xml of the list:

<Field ID="{25b21cbb-c154-4dda-ac58-506a5853e5de}" Name="mlClientID" 
StaticName="mlClientID" Type="Lookup" DisplayName="Company" List="Lists/mcompany" FieldRef="ID" ShowField="Title" Group="Custom Columns" />

When I removed FieldRef=”ID” and then re-created the list it solved the problem.

I am not really sure why or what is going on in the background that causes this issue but I hope this helps someone incase you have the same problem.