People Search Returns no Results on https

This is a simple one (hopefully).
The SSP3 protocol is used when defining the content sources for the SSP

For example

sps3://mysite.yourdomain.com/

sps3://www.yourdomain.com/mysite/

sps3://my.yourdomain.com/

If you are using SSL on your My Site host header, the SPS3S protocol should be used instead instead.

For example

sps3s://mysite.yourdomain.com/

After you’ve updated the content source, run a full crawl and you should now have people results!

We’re having a problem opening this location in File Explorer.

There are a few circumstances under which you may come across this error :

We’re having a problem opening this location in File Explorer.  Add this web site to your Trusted Sites list and try again

Here I will provide a solution for one of those – You are trying to open a SharePoint document library in explorer view while on the SharePoint server.

There is an excellent post here that provides a detailed description of the problem and solution, but to summarise, you need to install the Desktop Experience feature under User Interfaces and Infrastructure on the server.

Getting SPListItems from a multi-value Lookup Column

I have put this example together because I wanted to demo how to get multiple SPListItems from a lookup column rather than just the one OR just the lookup value/text. Anyway, it’s a handy piece of code to have on hand because lookup columns are always a little tricky to deal with but they are also super useful. For example, I used the code below in a web part that filters displayed list items based on a complex filter defined in another list. So rather than having one column which defined a filter i.e. ‘User=Me’ I had a whole list of columns which each defined a specific filter: type, condition for applictaion, property and value.  

 public bool displayItem(SPListItem listItem)
        {
            bool displayItem = true;
            try
            {
                if (!String.IsNullOrEmpty(listItem[“PreferenceFilter”].ToString()))
                {
                    if (listItem.Fields[“PreferenceFilter”] is SPFieldLookup)
                    {
                        SPFieldLookup lookupField = (SPFieldLookup)listItem.Fields[“PreferenceFilter”];
                        Guid webID = lookupField.LookupWebId;
                        Guid listID = new Guid(lookupField.LookupList);
                        string[] splitStr = { “;”, “#” };// 2;#Filter1;#3;#Filter2              

  splitStr = listItem[“PreferenceFilter”].ToString().Split(splitStr, StringSplitOptions.RemoveEmptyEntries);
                        for (int i = 0; i < splitStr.Length; i = i + 2)
                        {
                            int itemID = Int32.Parse(splitStr[i]);
                            SPListItem lookupItem = SPContext.Current.Site.OpenWeb(webID).Lists[listID].GetItemById(itemID);
                            string filterType = lookupItem[“FilterType”].ToString();
                            string propName = lookupItem[“PropertyTitle”].ToString();
                            string propValue = lookupItem[“PropertyValue”].ToString();
                            if (FilterType… && PropertyTitle….)
                            {

                                 displayItem = false;
                              }

                                etc

Installing and customising a test environment based on a production SharePoint environment

When clients request a test environment as an “after thought” to installing and configuring a production environment you’ve got to make a few decisions about how this will be done. This post will outline how I prefer to swing it and what has worked for me so far. Keep in mind though that farm size and capacity should dictate your methods. The methods I discuss here fit for a small to medium size farm.

Virtualisation

Where possible recommend setting up virtual servers to replicate the production environment. This is usually a lot cheaper and allows for a lot more flexibility. You quite often see businesses using a test environment which is a single server setup despite their production farms containing multiple servers. It is always best to try to mimic the environment completely and with virtual servers this is a bit easier as you can magically conjure a swish new server from virtually nothing 😉

Snapshot or fresh install

Fresh install definitely, although I can’t say I’ve ever tried the alternative. If the prod environment happens to be virtual too I wouldn’t recommend taking a snapshot and restoring it as a test environment. I can imagine all kinds of conflicts and issues with that and you reeeeally don’t want to jeopardize your production environment. I prefer to start from scratch and install the pre-requisites, SharePoint, services packs and updates again.

Database Servers- to share or not to share

I usually recommend sharing (remember I am talking about small to medium farms here) but that’s usually because it’s the more preferred, cheaper option. If you already have a spare SQL server sitting around, you can certainly take advantage of that. I do find it a bit of an advantage sharing with production though when it comes to troubleshooting issues. Remember we really want prod and test to be identical. When an error is occurring on the prod environment and it is also occurring on the test server you can pretty much assume the issue is occurring in a shared resource which narrows down the search somewhat. I always recommend creating a separate SQL instance for test though. That way you can keep you DB naming convention the same and it’s not confusing when trying to figure out which DBs are for prod and which are for test.

Back-end Configuration

Set your SSP and services up as you did in production although it doesn’t really matter if this is exactly the same. For example the user profile import probably doesn’t need to run quite as regularly as it does in production but then again I have been pushing the identical environment thing so you may just want to make the effort and set them up with exactly the same schedules. If you have created an “as built/installed” document previously with all this configuration detail, now is a great time to test is accuracy.

Content Database Migration

Now as you have installed SharePoint in the exact same way as in production (with all the latest updates and service packs) you can relax and know that you can add your production content databases to the test farm no problems at all. What I have found works best is to create the root web application, let’s say SharePoint-80 , in the test system and if you want, create a site collection and navigate to it to make sure all your install efforts have not been in vain and everything is working. Then backup and restore your production root web app content DB to the test instance and overwrite the root site DB with the same name. Once you’ve done this you can add the content database through the Central Admin GUI. That should be that, you should now be able to navigate to the root site and there should be all your production data. Migrate any other content databases as needed and add through GUI.

Customisation

Now this part will depend on the type of customisation you have gotten your hands dirty with. If SharePoint designer is your friend and most of your customisations have been through designer you should make pretty short work of it. These customisations will be stored in the content databases you have already migrated. Any custom web parts or features used in production will have to be migrated into the test file system (GAC/bin/hive directory). You also have to install and activate any features you whack in the hive – just because they are in there doesn’t mean the job is done. If you have wrapped up all your customisations in lovely little solutions that you must now set to work deploying those (well done SharePoint nerd). If you have been a good developer you won’t come across any nasty dependencies which dictate in which order you deploy your solutions. Lastly, if you are a bit naughty sometimes and make changes to files in the hive directory (like blog site templates etc) then you need to make sure those files have been migrated from production too. I tend to apply these customisations across all SharePoint servers in the farm even if they are not WFEs. That way, if you ever need to swap one in for a sick WFE, its easy peazy.

Adding web parts to list forms without ghosting the form

This is the niftiest post I’ve read in a long time! Paul Culmsee, you are my MOSS idol. This post is pretty much for my own selfish use. I can see myself using this “polite hack” regularly so I want to make sure I’ve got it in close proximity.

Ok so all you need to do is navigate to your list form in a browser  and append:  &ToolPaneView=2 to the URL. This will display the Add Web Part tool pane so you can add/remove web parts as you like.

401 Unauthorised when calling SharePoint web services

Recently while developing and testing a web service which called the SharePoint lists.asmx service I consistantly received a ‘401 unathorised’ exception when calling the lists.asmx method getlistitems(..). I passed the default network credential and ran the app under the system/farm account, I created a new network credential and used service account credentials but no matter what, I always got the 401. After much frustration I found this kb article: http://support.microsoft.com/?scid=kb;en-us;896861&x=14&y=17 which fixed the issue.
 
Cause:
This issue occurs if you install Microsoft Windows XP Service Pack 2 (SP2) or Microsoft Windows Server 2003 Service Pack 1 (SP1). Windows XP SP2 and Windows Server 2003 SP1 include a loopback check security feature that is designed to help prevent reflection attacks on your computer. Therefore, authentication fails if the FQDN or the custom host header that you use does not match the local computer name.
 
Workaround:
To work around this issue, use one of the following methods.

Method 1: Specify host names

To specify the host names that are mapped to the loopback address and can connect to Web sites on your computer, follow these steps:

  1. Click Start, click Run, type regedit, and then click OK.
  2. In Registry Editor, locate and then click the following registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
  3. Right-click MSV1_0, point to New, and then click Multi-String Value.
  4. Type BackConnectionHostNames, and then press ENTER.
  5. Right-click BackConnectionHostNames, and then click Modify.
  6. In the Value data box, type the host name or the host names for the sites that are on the local computer, and then click OK.
  7. Quit Registry Editor, and then restart the IISAdmin service.

Method 2: Disable the loopback check

Follow these steps:

  1. Click Start, click Run, type regedit, and then click OK.
  2. In Registry Editor, locate and then click the following registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
  3. Right-click Lsa, point to New, and then click DWORD Value.
  4. Type DisableLoopbackCheck, and then press ENTER.
  5. Right-click DisableLoopbackCheck, and then click Modify.
  6. In the Value data box, type 1, and then click OK.
  7. Quit Registry Editor, and then restart your computer

Breadcrumbs in SharePoint content pages are over-ridden

You’ll know what I’m talking about here if you have ever tried to customize the blog site template. When you create a MOSS blog site you’ll notice that the left nav bar and breadcrumbs are different to those in other standard sites, despite setting the site to use the same master page. In some cases, SharePoint just decides to override stuff in your master page and there ain’t a gosh darn thing you can do about it- using the GUI anyway. You can however, modify the site template files to better suit you and use the same nav as your master page. This is a bit of a no no because you will be modifying files in the hive directory, so if you want to be all “best practice” about it, you should copy the blog site template and create your own custom template to use instead.

Anyway, for the purpose of this post I will talk you through modifying the hive files.  On your WFE/s server navigate to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\Blog

Backup and edit the default.aspx page. Replace:

<asp:Content ContentPlaceHolderId=”PlaceHolderTitleBreadcrumb” runat=”server”/>

 

and

 

<asp:Content ContentPlaceHolderId=”PlaceHolderLeftNavBar” runat=”server”>

                <div class=”ms-BlogNavigator”>

                <div class=”ms-quicklaunchouter”> <div class=”ms-quickLaunch” style=”width:100%”>

                <Sharepoint:SPSecurityTrimmedControl runat=”server” PermissionsString=”ViewFormPages, ManageLists”>

                                <div class=”ms-quicklaunchheader”><SharePoint:SPLinkButton id=”idNavLinkViewAll” runat=”server” NavigateUrl=”~site/_layouts/viewlsts.aspx” Text=”<%$Resources:wss,quiklnch_allcontent%>” AccessKey=”<%$Resources:wss,quiklnch_allcontent_AK%>”/></div>

                </SharePoint:SPSecurityTrimmedControl>

                                <WebPartPages:WebPartZone runat=”server” FrameType=”TitleBarOnly” ID=”BlogNavigator” Title=”loc:BlogNavigator” />

                <div id=”BlogRSSNav”></div>

                </div></div>

                </div>

</asp:Content>

 

With asp:Content tags containing your desired controls (cut and paste from your master page if need be) e.g.

 

<asp:Content ContentPlaceHolderid=”PlaceHolderTitleBreadcrumb” runat=”server”>

<div class=”breadcrumb”>

You are here:

<asp:SiteMapPath ID=”siteMapPath” Runat=”server” SiteMapProvider=”CurrentNavSiteMapProviderNoEncode” RenderCurrentNodeAsLink=”false” CurrentNodeStyle-CssClass=”breadcrumbCurrent” NodeStyle-CssClass=”ms-sitemapdirectional” CssClass=”body”/>

</div>

</asp:Content>

 

Now in the case of the blog site template it gets a bit more complicated because there are several pages used when creating posts and categories etc so you have to update these files in the same way. These pages are stored in the template’s Lists folder C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\Blog\Lists