Pages

Thursday, March 15, 2012

SharePoint Search Web Services and anonymous access

Recently had to debug an issue with a 3rd Party app using the /_vti_bin/search.asmx web service which, at the time, stopped working with 'no changes' to the environment. We were receiving the SoapException: 'Server was unable to process request ... Unauthorized Operation'.

This turned out to be not quite the truth and infact Anonymous Access was enabled on the Web Application for use by a monitoring tool. The Farm configuration doesn't use Kerberos (jury is still out on whether Kerberos is needed in this situation anyway), just Ntlm and it seems that once a successful connection is made to another SharePoint web service (in this case /_vti_bin/lists.asmx) then a subsequent call to the search service works.

We did a bit of packet sniffing as well and it looks like the search service trys to authenticate differently than the other web services. Not sure why this is the case. I need to understand more about how Search works.

Here's the post on TechNet.

Moral of the story is to check, and double check the environment before spending time going down rabbit holes. Statements like 'it was working, then it stopped...with no change in the environment' just don't add up.

Thursday, January 5, 2012

Issue with DNS using VirtualBox and the SharePoint 2010 VHD

After many hours of trying and reading I finally stumbled across an article that described my problem and solution.
Thanks very much Edward http://microsoftdevguy.blogspot.com/2011/05/sharepoint-demo-image-gets-error.html
It seems that trying to follow the MS Install guide didn't quite work and after you successfully run the image, the only site you can hit is CA. After following Edwards article and just using a Bridged Adapter and an available IP address in the Host networks range, then modifying the Guest adapter and DNS entries, viola! Magic!

Thursday, May 5, 2011

SharePoint 2010 Debugging

This one always gets me… There’s a few things that need to be done in order to better debug SharePoint.

  • Custom Errors Off
  • Enable Call Stack Trace
  • Debugging Mode
  • ASP.Net Tracing

…and the big one.

  • Multiple web.config files.

OK, to break it down. First, know what Web Application you want to debug. This might sound silly but I’ve been caught out a few times with a couple of (not straight forward) sp farm setups.

SharePoint web.config files

Make sure you are looking at the right Virtual Directory. Also, as mentioned as the last bullet, there are multiple web.config files that might need modifying. Below is a scrape from a good article by Daniel on blogspot (thanks)

The web.config files are genearally found in the following locations:

  • web.config file in the root folder of each virtual server / IIS Application.

Local_Drive:\Inetpub\wwwroot
This is the usually the file that contains most of the web configuration of a SharePoint site collection. To display full errors you would need to modify this web.config file. There may be one for each of the SharePoint applications running in some cases (MySites, Multiple Portals or Instances of SharePoint, Central Admin, etc.). If this is the case, you will only need to modify the web.config file which is in the root of the virtual directory for the instance of SharePoint which you using. To find out which directory is used by various SharePoint applications/websites, view the properties of the SharePoint website in IIS and from the "Home Directory" tab, the value in the "Local path" field will take you to the directory where the web.config file is for the specific instance of SharePoint / Application in IIS.

  • web.config file used in Web Part resources for the Global Assembly Cache (GAC)

Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources

  • web.config configuration file(s) for extending other virtual servers

Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\CONFIG

  • web.config file which defines configuration settings for the /_vti_bin virtual directory

Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\ISAPI

  • web.config file which defines configuration settings for the /_layouts virtual directory

Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\LAYOUTS

  • web.config configuration file for Central Administration pages.

Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\ADMIN\Locale_ID

Now that you know what config files to modify, here are the key parts that need modification.

Custom Errors Off

Set the customErrors mode to "Off"
Find:
<system.web> ...
<customErrors mode="On" />
Change To:
<system.web> ...
<customErrors mode="Off" />

Enable Call Stack Trace

Set the CallStack value of the SafeMode element to "true"
Find:
<SharePoint>
<SafeMode ... CallStack="false" ... >
<SharePoint>

Change To:
<SharePoint>
<SafeMode ... CallStack="true" ... >
</SharePoint>

Debugging Mode

Set batch and debug to "true"
Find:
<compilation batch="false" debug="false">
Change To:
<compilation batch="true" debug="true">

ASP.Net Tracing

Include the following line in the <system.web> element of the web.config file.
<system.web> ...
<trace enabled="true" pageOutput="true"/>

And that’s about that. I will post a bit about debugging via log files soon.

Friday, April 29, 2011

SharePoint 2010 - User Profile Sync Issues

Tricky topic, heaps of articles out there, but...

Make sure that both FIM services are started before worrying about any user profile sync issues.

For instance, in the contoso VHD, I added new AD users but they would not sync. When viewing the Sync Connection, there wasn't any. So I tried creating a new one but there were drama's with this which led me to the solution, Make sure the FIM services are running. As soon as these services are running, the sync connection will be displayed in CA.

Thursday, April 29, 2010

Using ROW_NUMBER

ROW_NUMBER() OVER (PARTITION BY ORDER BY ) AS RowNum