Lambert's profileLambert Qin's technical ...PhotosBlogListsMore Tools Help

Lambert Qin's technical blog: SharePoint in my eyes

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
November 05

Crawling Exchange Server 2007 Public Folders in SharePoint Server 2007 (Part 2)

In previous blog, I simplify the configurations to a non-SSL environment, of cause, this is not the Exchange Server 2007 Default Settings and it is not fit for production environment, now I would like to change the settings back.

1. Remove All SSL setting in the Exchange Server 2007 (ignore the steps if you are using Default Settings).

1). Change the internal URL to back to HTTPs.

image

2). Un-check Require SSL option of SSL Settings in IIS Manager for OWA and Public virtual directory (vDir).

image_thumb3 image

3). Restart IIS using IISReset /noforce.

4). Access the Test public folder “https://exchangeserver/public for testing purpose.

you would see the URL direct to “https://exchangeserver/OWA” with an SSL certificate name warning.

image

You could ignore it by choosing Continue to this website, or add the certificate to Trusted Root Certification Authorities to resolve the issue.

(Optional) I do not like the default Exchange certificate (it is issued to NetBIOS name and make my demo failed a few times), so I create Self-Signed Certificate to replace it. you could create you own or using your current certificate based on your real environment.

In IIS Manager, Click Server Certificates.

image

In Actions, choose Create Self-Signed Certificate. Give a friendly name, click OK.

image

2. Add a new content source in SharePoint to crawl.

image

3. Start a Full Crawl for testing and an error 0x80040E4D.

image

if you checked Ignore SSL certificate name warnings in Central Administration > Application Management > Search Service > Farm-Level Search Settings, the error would looks like:

image

The error message for 0x80040E4D is DB_SEC_E_AUTH_FAILED which indicates this is an authentication error, and it seems a certificate error.

4. Add a crawl rule to attach the certificate.

1). Export the certificate from Exchange Server 2007 from IIS Manager.

image

image

image

2). Import to Index Server of SharePoint Farm.

Start > Run > mmc to open Microsoft Management Console.

 image

Add Certificates Snap-in to the console, and choose Computer account. Click OK.

image image

Import the certificate to Personal and Trusted Root Certification Authorities.

image image

3). Create a new rule for the IIS site hosts Exchange services and attach the certificate to the crawler.

image

5. Start a Full Crawl for testing again and get a weird certificate error which I totally do not understand.

image

forget it, I have already attached the certificate to the crawler.

6. Assign the crawler to use a account which has the permission to access to Exchange OWA.

You could choose using another content access account or form credentials based on your OWA configurations.

Please make sure this rule has priority over the certificate rule.

image

and the rules looks like:

image

7. Start a Full Crawl for testing. Congratulations!  You made it!

image

 

Comments:

The key point is the SSL certificate, you may also need to check the settings in Central Administration > Application Management > Search Service > Farm-Level Search Settings.

If you get warnings when access the Public Folder in IE, you need to make sure the option is checked.

image

 

Specially thanks to Weiyi Hu, who is a support engineer in Microsoft, Some of the steps come from one of her cases.

Crawling Exchange Server 2007 Public Folders in SharePoint Server 2007 (Part 1)

Steve Smith, MVP wrote a tutorial about How to configure a content Source to crawl Exchange 2003 public folders in Moss2007, and I saw lot of people asking how to crawling Exchange Server 2007 Public Folders.

Public folders changed a lot from Exchange 2003 to Exchange 2007, an obvious change is you cannot access via http(s)://exchangeserver/public/folder/subfolder, it would redirect to http(s)://exchangeserver/owa/. This changes causes that it is a bit hard to configure SharePoint to crawl Exchange Server 2007 Public Folders.

According to the article here, you need to have both Exchange Server 2007 Service Pack 1 and SharePoint Server Service Pack 1 installed before performing the actions.

 

First, I would like to make the scenario simple, I remove all the SSL things , it looks like a normal HTTP sites.

1. Remove All SSL setting in the Exchange Server 2007.

1). Change the internal URL to use HTTP instead of HTTPs.

image

2). Un-check Require SSL option of SSL Settings in IIS Manager for OWA and Public virtual directory (vDir).

image image

3). Restart IIS using IISReset /noforce.

4). Access the Test public folder “http://exchangeserver/public for testing purpose.

you would see the URL direct to “http://exchangeserver/OWA” and the classic logon windows asks for your credential, so far so good.

image 

2. Add a new content source in SharePoint to crawl.

image

3. Start a Full Crawl and check the results.

image image

 

If you are working on a demo or test farm, you could just remove the SSL to make life easier. In next blog, I would add the SSL back :)

November 02

Using Lookup column to maintain the relationship between two lists

Scenario:

This is an simple tutorial of using Lookup column to synchronize the data between two lists: Source List and Destination List.

1. In the Destination List, create a RefID which gets information from ID field of the Source List. Very similar with the Foreign Key in the SQL Server.

image

2. Create a simple workflow attached to Source List to create the initial the relationship.

image

image

3. Create a workflow attached to Destination List to sync the changes back to the Source List.

image 

 

image

4. Test results.

1) Create a new item in Source List and wait for the workflow to complete.

image

2) In the Destination List, a list is created by the workflow attached to Source List and the RefID has been filled out.

image

If you click the RefID, you could navigate back to Source List.

image

3) Modify the list item in Destination List, wait for the workflow attached to Destination List to complete.

image

Navigate to Source List, the change made in Destination List is synchronized.

image

Additional Comments:

1. SharePoint Designer workflow impersonates your current account, which means you need to have Contribute Permission (at least Edit List Item Permission) on both Lists.

To workaround the limitation, a Visual Studio workflow or an Event Receiver is needed. actually Event Receiver is more suitable for this scenario.

2. As the RefID is a key field in the two lists, I do not suggest to add the RefID to the exited lists because it is not easy to fill the empty values with correct ones.

3. The tutorial implements a limited function with  least actions, it should be extended with specific requirements.

October 29

contentclass and its values (may not complete)

Content class property could be used for restricting the results’ type of indexing.

Here are some of the values, in case i forgot them some day :)

image

"STS_Web": // Site

"STS_List_850": // Page Library

"STS_ListItem_850": // Page

"STS_List_DocumentLibrary": // Document Library

"STS_ListItem_DocumentLibrary": // Document Library Items

"STS_List_GenericList": // Custom List

"STS_ListItem_GenericList": // Custom List Item

"STS_List_Links": // Links List

"STS_ListItem_Links": // Links List Item

"STS_List_Tasks": // Tasks List

"STS_ListItem_Tasks": // Tasks List Item

"STS_List_Events": // Events List

"STS_ListItem_Events": // Events List Item

"STS_List_Announcements": // Announcements List

"STS_ListItem_Announcements": // Announcements List Item

"STS_List_Contacts": // Contacts List

"STS_ListItem_Contacts": // Contacts List Item

"STS_List_DiscussionBoard": // Discussion List

"STS_ListItem_DiscussionBoard": // Discussion List Item

"STS_List_IssueTracking": // Issue Tracking List

"STS_ListItem_IssueTracking": // Issue Tracking List Item

"STS_List_GanttTasks": // Project Tasks List

"STS_ListItem_GanttTasks": // Project Tasks List Item

"STS_List_Survey": // Survey List

"STS_ListItem_Survey": // Survey List Item

"STS_List_PictureLibrary": // Picture Library

"STS_ListItem_PictureLibrary": // Picture Library Item

"STS_List_WebPageLibrary": // Web Page Library

"STS_ListItem_WebPageLibrary": // Web Page Library Item

"STS_List_XMLForm": // Form Library

"STS_ListItem_XMLForm": // Form Library Item

August 31

Create an survey with pictures and other HTML formats

One of the limitations of SharePoint is that it only support an simple text format survey which is not enough for many scenarios.

However, create a full customized ASP.NET survey for SharePoint is not easy, it involves a lot of coding work.

Here is an general method that help administrartors and power users who have limited coding skill to build a beautiful survey.

Step 1: create an OOB survey.

image

Step 2: Open the survey in SharePoint Designer,upload a picture which would be used later.

image

Step 3:Create a HTML page in SharePoint Designer, design your survey. Copy the HTML code.

image

Step 4:Paste the HTML into the question (notice: must include the Table tag)

image

Preview:

image

Step 5:Copy the JavaScript to the form files (newForm,editForm and etc.)

document.getElementsByTagName('Table').item(0).outerHTML
=
document.getElementsByTagName('Table').item(0).outerHTML.replace(/&lt;/g,'<').replace(/&gt;/g,'>');

Tips: if you do not know where to insert the code, look for the following area which contains an OOB JavaScript code

image

Preview:

image

 

Comments:

The functionality of the JavaScript converts the escape character back, so that the pictures and HTML codes display correctly.

 

Updates [2009-11-02]:

Thanks for Mike Sharp’s idea here: http://social.technet.microsoft.com/Forums/en-US/sharepointcustomization/thread/8b97bc31-f72d-4104-bd40-d8d72a8f7fbf

There should be a potential for XSS, and narrow the scope of what gets un-escaped should reduce the risks:

For DispForm, NewForm and EditForm pages. using
document.getElementById('onetIDListForm').rows[0].cells[0].innerHTML = document.getElementById('onetIDListForm').rows[0].cells[0].innerHTML.replace(/&lt;/g,'<').replace(/&gt;/g,'>');
For the Summary page doesn't have the same onetIDListForm cell, using the ID of the web part zone TD cell:
document.getElementById('MSOZoneCell_WebPartWPQ2').innerHTML = document.getElementById('MSOZoneCell_WebPartWPQ2').innerHTML.replace(/&lt;/g,'<').replace(/&gt;/g,'>');

 

Lambert

Occupation
Location
Thanks for visiting!
Please wait...
Sorry, the comment you entered is too long. Please shorten it.
You didn't enter anything. Please try again.
Sorry, we can't add your comment right now. Please try again later.
To add a comment, you need permission from your parent. Ask for permission
Your parent has turned off comments.
Sorry, we can't delete your comment right now. Please try again later.
You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
Complete the security check below to finish leaving your comment.
The characters you type in the security check must match the characters in the picture or audio.
No list items have been added yet.
This person's network is empty (or maybe they're keeping it private).