Tuesday, March 31, 2009

Access is denied. Check that the Default Content Access Account has access to this content, or add a crawl rule to crawl this content

I was trying to crawl the "Local Office SharePoint Server sites" content source to make my site data appear in the search result. I already configured the starting url (web application url) of my site in the "Start Addresses" section of the "Local Office SharePoint Server sites" content source properties.

But i was getting the following error message from the crawl log. Only the site i was working is not crawled and the other sites got crawled successfully.

http://mysharepointserver:7708 Access is denied. Check that the Default Content Access Account has access to this content, or add a crawl rule to crawl this content. (The item was deleted because it was either not found or the crawler was denied access to it.)

I understood the error was something related to the security configuration and found that my site was using the "Basic authentication" and the rest of the sites were using "Integrated windows authentication". By default the crawler can't access the sites using "Basic authentication" security mode. The following workarounds can be done to get rid of this issue.

Approach 1:

  1. Extend the problematic web application under a different name and use "Integrated windows authentication" for that newly created extended web application.
  2. Remove the URL of the problematic web application from the "Local Office SharePoint Server sites" properties and add the newly created extended web application.

Approach 2:

  1. Check the "Default content access account" in the Crawl settings page.
  2. Add the same account in the site which needs to be crawled.

"Quick Launch" link is missing in the "Look and Feel" section of SharePoint site settings

As per one of my customization task i was adding various links in the Left Navigation of my site by using the "Quick Launch" option under the "Look and Feel" section of the site settings.

The issue was, suddenly the "Quick Launch" link was missing from the site settings page. I tried various options and couldn't find the exact reason for the problem. I completed my work by accessing the following URL as a workaround.
http://mysharepointserver:6666/sites/myplayground/_layouts/quiklnch.aspx

I was investigating about this problem and found the following points as root cause of the above issue.
  1. "Quick Launch" link will be replaced by the "Navigation" link if we activate the "Office SharePoint Server Publishing Infrastructure" feature. (This was activated by another user simultaneously accessed my site. That caused the confusion)
  2. We can still do all the functionalities provided by "Quick Launch" using the "Navigation" option with added features like audience and ordering of the links.

LoadBalancer.RegisterLauncher failed: Unable to connect to the remote server

I was trying to enable the Internet in my Virtual machine. While trying various steps i found the local sharepoint site and the central admin were not accessable. I was keep getting the following error in the Event log.

"LoadBalancer.RegisterLauncher failed: Unable to connect to the remote server"

Since i was trying many settings changes and many approaches to enable the internet i couldn't remember which settings or the approach was causing the problem.
However, I was able to get my sites back online by doing the following workaround. Still trying to find the rootcause of the problem, most probablly it might be related to the various IP address settings changes i tried. The following workaround resolved the problem.
  1. Start-->Run and type the "drivers"
  2. Open the "etc" folder
  3. Open the "hosts" file in Notepad.
  4. Enter the IP and domain name mapping

Extracting email address from the "Assigned To" (people picker) column

I was creating a Job to send email alerts to the people whose assigned tasks are overdue. Tasks are getting created in a TaskList library by a workflow.

The job should check the DueDate column value and if it is overdue then it should send a email to the person specified in the "Assigned To" column.

The issue here is the Assigned To column value was something like "TestDomain\TestUser". I couldn't send mail using that and I required the exact email address of the "TestUser" like "Testuser@abccompany.com". I tried various approaches and the following one worked perfectly well for my scenario. [The "TestDomain" users should be imported in the SharePoint User Profiles]

try
{
SPSite site = new SPSite("
http://mysharepointsite:6666/sites/site1");
SPWeb web = site.OpenWeb();
SPList list = web.Lists["Tasks"];
SPListItem item = list.Items[0];
string userName = list.Items[0]["Assigned To"].ToString();
SPFieldUser field = (SPFieldUser)item.Fields["Assigned To"];
SPFieldUserValue fieldValue = (SPFieldUserValue)field.GetFieldValue(userName);
MessageBox.Show(fieldValue.User.Email);
}
catch (Exception ex)
{

MessageBox.Show(ex.Message);
}

Tuesday, March 24, 2009

InfoPath form publishing Error: "The following URL is not valid "http://...."

Whenever we we try to publish the InfoPath forms using the File-->Publish option to a SharePoint server list we used to get the following error.

"The following URL is not valid "http://exampleurl/sites/sitecollection1"

We were able to resolve this issue by using either of the following approaches

Approach1:

  1. Creating a root site for the web application. (Don't know how this is fixing the issue. But its working :))

Approach2:

  1. Publish the template to a network location
  2. Upload the published template to the central admin.
  3. Activate the template as a content type feature in the site collection.
  4. Add the site content type into the form library.
  5. User the form using new-->form name(content type name)

Monday, March 23, 2009

Enabling Internet inside the Virtual Machine.[WS 2003]

We were trying to use the Internet inside our Virtual Machine. But the default settings in the virtual Machine were not supporting. However we were able to enable the internet by using the following settings.
Selecting the "Shared networking (NAT)" option in the "Networking" section of the Virtual Machine.

and by setting the "Obtain an IP address Automatically option" in the Local Area Connection Properties-->TCP/IP Properties.