Thursday, January 26, 2012

SharePoint 2010 Central Administration shows HTTP 404 Error after Installation

Hello Folks,

I have built lot of SharePoint Farms in my project. But came across with a new issue in IIS after the installation of first Application Server hosting Central Administration. Installation went successful oh la la!!! but there are other worries waiting for me when I tried to access SharePoint 2010 Central Administration page.

Guess what, it displayed a very simple page with a "HTTP 404 Error". I started to wonder what screwed up in the installation which caused Central Admin site to break. I quickly verified my log files all seems to be fine and cool.

I turned to the basics of Web sites and IIS, leaving SharePoint concepts and shifted my attention to verify IIS settings. Again as expected IIS is the culprit and got to know something new this time called "HTTP Verbs".

HTTP Verbs are the one responsible to allow or deny HTTP requests for the Web Server via Request Filtering

I verified the HTTP Verbs in some of the other Farms and added the following HTTP Verbs to be processed in IIS-> Request Filtering settings in my server

GET
POST
HEAD
CONNECT
PUT
DELETE
TRACE
OPTIONS

Problem: SharePoint Central Admin Page diplays HTTP 404 Error after Installation

Cause: HTTP Verbs are not configured to allow in IIS

Resolution: Go to the server where SharePoint Central Admin is hosted, Start -> Run -> Type inetmgr -> Click OK -> Expand Server_Name -> Expand Sites -> Click Web Application -> Click Request Filtering under IIS on the Right -> Double click "Request Filtering" -> Click on HTTP Verbs->Click Allow from the top right corner and enter GET and click OK. Repeat the same steps to allow other verbs POST, HEAD, CONNECT, PUT, DELETE, TRACE, OPTIONS and Central Administration started to load properly

Note: If you require, future web applications not to face this issue, then the settings has to be applied to the IIS level as well. Following are the steps to apply the same

Go to the server where SharePoint Central Admin is hosted, Start -> Run -> Type inetmgr -> Click OK -> Click on Server_Name -> Click Request Filtering under IIS on the Right -> Double click "Request Filtering" -> Click on HTTP Verbs->Click Allow from the top right corner and enter GET and click OK. Repeat the same steps to allow other verbs POST, HEAD, CONNECT, PUT, DELETE, TRACE, OPTIONS

Hope this helps!!!

Happy bug fixing!!!

Wednesday, January 25, 2012

SharePoint 2010 - People Picker displays blank page

Hi,

Last week I came across an issue where SharePoint 2010 People Picker displayed a "Blank Page" instead of displaying the users. It was very strange as other SharePoint Pages were working fine. We have built lot of SharePoint 2010 farms before and never faced this issue, so that gave us a clue to rule out possible errors in SharePoint 2010. The other two bits which need to verify are windows firewall or IIS Settings.

Windows firewall - Should not be an issue as All pages in the server accessed via same port and other pages are working fine.

IIS Settings - hmm ya interesting to notice SQL Injection Settings applied on IIS Server. It was applied as part of Organization policy to block any SQL Query attacks to Databases via Query Strings. There was something bothering to proceed before confirming is SharePoint 2010 if fool proof enough to remove this settings. After googling around I found an article from MSDN which clarifies the same.

http://social.technet.microsoft.com/Forums/en-US/sharepoint2010setup/thread/6b48e7ac-a393-48b4-ba24-6e56cd8b7ebc/

Once we removed the SQL Injection Settings from IIS on all the Web Front Ends. People Picker started to return expected results

Problem: People Picker returns Blank Page

Cause: SQL Injection Settings applied on the IIS

Resolution: Go to all Web Servers, Start -> Run -> Type inetmgr -> Click OK -> Expand Server_Name -> Expand Sites -> Click Web Application -> Click Request Filtering under IIS on the Right -> Double click "Request Filtering" -> Click on Rules -> Click on Rules related to SQL Injection (name can be anything defined, most probably it will deny certain strings which has SQL Keywords in Query Strings) -> Either remove the rule completely or remove the denied strings within the rule Whichever is applicable. Repeat the steps for all the Web Front Ends, This will resolve the issue.

Note: If you require, future web applications not to face this issue then the settings has to be applied to the IIS level as well. Follow the following steps to apply the same

Go to all Web Servers, Start -> Run -> Type inetmgr -> Click OK -> Click on Server_Name -> Click Request Filtering under IIS on the Right -> Double click "Request Filtering" -> Click on Rules -> Click on Rules related to SQL Injection (name can be anything defined, most probably it will deny certain strings which has SQL Keywords in Query Strings) -> Either remove the rule completely or remove the denied strings within the rule Whichever is applicable. Repeat the steps for all the Web Front Ends, This will make sure all future web applications will not face this issue.

Other Issues related:
The same issue is applicable while accessing "View All Site Collections Page" in SharePoint 2010 Central Administration Screen. SharePoint Central Admin ->
Application Management-> View All Site Collections.

Precuation:
The fix is for SharePoint 2010 Out of the box pages which are confirmed from MSDN that there are no vulnerable SQL Injection attacks by the Product. However for custom solutions or custom pages deployed in SharePoint 2010, it is responsiblity of the Deployment team to review this settings for custom code and approve it to be deployed.

Hope this helps!!!

Happy bug fixing!!!

Thursday, February 17, 2011

The path must point to a fixed, NTFS drive whose root directory exists.

Hi,

Just wanted to share a quick fix in SharePoint 2010 Search which I faced today, this error almost took me for a toll with no help in Internet :(, finally I was able to successfully
resolve the issue with bit of thinking and support from my colleague.

Scenario: Installed SharePoint via Power shell Scripts in SharePoint 2010 Farm (3 App Servers, 3 WFE's and 1 SQL Server). Unable to create Crawl or Index components in some of the machines.

Error: While creating new crawl components or Query & Index partitions, SharePoint 2010 keep on prompting the message "The path must point to a fixed, NTFS drive whose root directory exists."
Note: The error prompts while trying via Central Administration and via Powershell Scripts it hangs to activate the components

Solution: Execute the following command in Power shell and wait for 15 minutes to reflect the changes

Repair-SPManagedAccountDeployment

Via scripting, add the following lines at the top

Repair-SPManagedAccountDeployment
sleep 900

Hope this little fix will help other users to come up with a solution quickly.

Following is the complete script for Crawl and Query Components

Crawl Component

try
{
$ServerName = $env:COMPUTERNAME

Repair-SPManagedAccountDeployment
sleep 900


#Start Search Service Instance
$searchInstance = Get-SPEnterpriseSearchServiceInstance | where {($_.server) -match $ServerName}
if ($searchInstance.status -eq "Disabled")
{
Start-SpEnterpriseSearchServiceInstance -identity $ServerName
}

## Wait
Write-Host -ForegroundColor Blue " - Waiting for Search Service Instance to start..." -NoNewline
While ($searchInstance.status -ne "Online")
{
Write-Host -ForegroundColor Blue "." -NoNewline
start-sleep 1
$searchInstance = Get-SPEnterpriseSearchServiceInstance | where {($_.server) -match $ServerName}
}
Write-Host -BackgroundColor Blue -ForegroundColor Black " ......: Search Service Started!"

#Get Service Application
$searchApp = Get-SPServiceApplication | ? {$_.TypeName -eq "Search Service Application"}

write-host Getting Initial Crawl Topology
# Retrieve the active topology
$InitialCrawlTopology = $searchApp | Get-SPEnterpriseSearchCrawlTopology -Active
$InitialCrawlTopology


write-host Cloning Crawl Topology
# Clone the topology
$CrawlTopology = $searchApp | New-SPEnterpriseSearchCrawlTopology -Clone -CrawlTopology $InitialCrawlTopology

write-host Creating new crawl component
# Create the new crawl component
$CrawlDatabase0 = ([array]($searchApp | Get-SPEnterpriseSearchCrawlDatabase))[0]
$CrawlComponent0 = New-SPEnterpriseSearchCrawlComponent -CrawlTopology $CrawlTopology -CrawlDatabase $CrawlDatabase0 -SearchServiceInstance $searchInstance -IndexLocation $CrawlComponents
$CrawlComponent1 = New-SPEnterpriseSearchCrawlComponent -CrawlTopology $CrawlTopology -CrawlDatabase $CrawlDatabase0 -SearchServiceInstance $searchInstance -IndexLocation $CrawlComponents

write-host Activating new crawl topology
# Activate the new crawl topology
$CrawlTopology | Set-SPEnterpriseSearchCrawlTopology -Active
Write-Host -ForegroundColor white Waiting for the old crawl topology to become inactive
do {write-host -NoNewline .;Start-Sleep 10;} while ($InitialCrawlTopology.State -ne "Inactive")

sleep 900


write-host Deleting Crawl Topology
# Delete the old crawl topology
$InitialCrawlTopology | Remove-SPEnterpriseSearchCrawlTopology

sleep 100

}
catch
{
Write-Output $_
}

Query Component

try
{
$ServerName = $env:COMPUTERNAME

Repair-SPManagedAccountDeployment
sleep 900

#Start Search Service Instance
$searchInstance = Get-SPEnterpriseSearchServiceInstance | where {($_.server) -match $ServerName}
if ($searchInstance.status -eq "Disabled")
{
Start-SpEnterpriseSearchServiceInstance -identity $ServerName
}

## Wait
Write-Host -ForegroundColor Blue " - Waiting for Search Service Instance to start" -NoNewline
While ($searchInstance.status -ne "Online")
{
Write-Host -ForegroundColor Blue "." -NoNewline
start-sleep 1
$searchInstance = Get-SPEnterpriseSearchServiceInstance | where {($_.server) -match $ServerName}
}
Write-Host -BackgroundColor Blue -ForegroundColor Black " ......Started!"

$searchApp = Get-SPServiceApplication | ? {$_.TypeName -eq "Search Service Application"}


write-host Retrieving Active Topology
# Retrieve the Active Query Topology
$InitialQueryTopology = $searchApp | Get-SPEnterpriseSearchQueryTopology -Active
$InitialQueryTopology

write-host Cloning Query Topology
# Create New topology
$QueryTopology = $searchApp | New-SPEnterpriseSearchQueryTopology -Partitions 2


write-host Adding Query Components
$IndexPartition0 = ([array](Get-SPEnterpriseSearchIndexPartition -QueryTopology $QueryTopology))[0]
$QueryComponent0 = New-SPEnterpriseSearchQuerycomponent -QueryTopology $QueryTopology -IndexPartition $IndexPartition0 -SearchServiceInstance $searchInstance -IndexLocation $QueryComponents

$IndexPartition1 = ([array](Get-SPEnterpriseSearchIndexPartition -QueryTopology $QueryTopology))[1]
$QueryComponent1 = New-SPEnterpriseSearchQuerycomponent -QueryTopology $QueryTopology -IndexPartition $IndexPartition1 -SearchServiceInstance $searchInstance -IndexLocation $QueryComponents


# Reuse the existing property database
$PropertyDatabase0 = ([array]($searchApp | Get-SPEnterpriseSearchPropertyDatabase))[0]


# Assign three index partitions to the property database
$IndexPartition0 | Set-SPEnterpriseSearchIndexPartition -PropertyDatabase $PropertyDatabase0
$IndexPartition1 | Set-SPEnterpriseSearchIndexPartition -PropertyDatabase $PropertyDatabase0

write-host Activating new query topology
# Activate the new query topology
$QueryTopology | Set-SPEnterpriseSearchQueryTopology -Active
Write-Host -ForegroundColor white Waiting for the old query topology to become inactive
do {write-host -NoNewline .;Start-Sleep 10;} while ($InitialQueryTopology.State -ne "Inactive")

sleep 900


write-host Deleting old query topology
# Delete the old query topology
$InitialQueryTopology | Remove-SPEnterpriseSearchQueryTopology

}
catch
{
Write-Output $_
}

Sunday, November 9, 2008

Export spread sheet option in MOSS 2007

Hi all,
Last week i had a small requirement in my project, where i need to enable "Export spread sheet" to Sharepoint Viewers group(Usually users in Viewers group will not have access to use "Export to spread sheet" option) of the sharepoint site.
To accomplish this, I have decided to create a simple web part page where in i will drag and drop the list in the web part page and add another Content Editor Web part.
Now, Modify the content editor webpart to create the html link with the following url.

http://servername/Sitename/([Subsitename]/)_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List=[ListGUID]&View=[ViewGUID]&CacheControl=1

Save the changes, your job is done :-)

WSS/MOSS + There are no products affected by this package installed on this system

Hey guys,
If any of you recieve an error "There are no products affected by this package installed on this system" while installing MOSS/WSS updates. Make sure you have downloaded the appropriate windows version update from Microsoft site.
Eg: I was getting the error "There are no products affected by this package installed on this system" when I tried to install wssv3sp1-kb936988-x64-fullfile-en-us.exe, instead i have to download and install wssv3sp1-kb936988-x86-fullfile-en-us.exe for my system configuration..
Hope this helps
Happy programming :-)

Monday, October 27, 2008

Ready->Study-Go

Hi all,
This is the first blog of my life. I was inspired to blog from some of my colleagues and online friends, especially i am very much motivated by Shahil Malik's blog on sharepoint technical reference. I will try to post as much technical references related to sharepoint in the near future. Your comments and feedbacks are always welcome :-)