SharePoint 2010 Claims based Forms Authentication

Forms based authentication in SharePoint 2010 has changed.  It is now Claims based Forms Authentication, which means all the forms configuration stuff you see all over the web doesn't quite work in the same way.  Even if you set the membership and role providers in your web
applications and central administration you forms auth still won't work!

In SharePoint 2010, several new WCF services will be handleing the mapping of the claims to the backend forms auth identities.  Out of the box, claims based forms auth doesn't work!  You gotta remove the <clear/> element from the Membership and Role provider sections in the web.config of the {SharePoint Root}WebServicesRoot.

Chris

WCF Timeouts on small memory’d SharePoint 2010 machine

In writing labs for an upcoming Microsoft Course, I found that the limitations on my environment was less than satisfactory to run all of the services of SharePoint 2010 at the same time.  Even though all Web Application and app pools were running, I was getting WCF timeouts mainly for the User Profile Service.  The default timeout value in SharePoint for the services is pretty much set to 20 sec.  If you have a machine that doesn't have the full 8GB of memory needed, then you may find your services are taking a while to spin up.  This can be devistating to some of the setup/install things you may be doing (because there are still many things that are NOT transnational). 

I found that by increasing the WCF timeout, I could avoid a lot of setup/install problems (mainly around service applications like User Profile).  To change the WCF timeout, open the C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14WebClientsProfileclient.config file, update the Bindings to double the timeout from "00:00:20" to "00:00:40".  Bam!  Your user profile won't timeout all the time and the service management page will display!

Chris

 

SharePoint 2010 Generic Solution Validator

Sandboxed Solutions are not a very practical way of  testing solutions in production.  It opens up a world of bad things to happen.  That being said, there are still some good things that can come from them. 

The blocking solution provided in Central Administration is a complete joke, it won't help you for governing sandboxed solution deployment AT ALL.  However, I have built a tool that will solve many of the deployment issues with Sandboxed Solutions.  I call it the Generic Solution Validator.  It is scoped to a Site Collection level and allows you to ALLOW or BLOCK solutions based on various properties.  Properties much more valuable than the SCA provides.

I have posted the Generic Solution Validator to codeplex. 

http://bit.ly/4V8Yv7

Enjoy,
Chris

SharePoint Timer Jobs

Have I mentioned how much I don't like Timer Jobs?  Let me rephrase that, timer jobs that other people write that aren't designed correctly?  Yeah, irks me.  So we can't say that all the Timer Jobs in the Beta are perfect, some have some issues, but its beta and we should come to expect not everything is going to work right now. 

For those that really cause us trouble though, how do we debug them?  We can attach to the owstimer.exe service I suppose, but then you are causing more problems with the other jobs waiting to get some of the precious CPU cycles while your debugging.

So how about we try a different approach?  I like using SQL Profiler, it is one of my favorite tools. It comes in really handy to figure out what really is going on on a SharePoint page (the Developer Dashboard is nice, but don't let it fool you, there is more going on than what it tells you) and…Timer Jobs.  problem is, sql profiler requires you to get really specific about what you want to see.  Not much you can do when everything coming in is tagged as a ".NET Application"…except for…turn everything OFF!

Turn off all the services, turn off all the timer jobs you don't want to look at or care about.  Turning off services is easy enough to do…timer jobs…ugg…little more difficult.  What about searching for a timer job?  Yeah, good luck with that one with just Out of the Box.

So I built a neat little tool and posted it to codeplex.  It lets you turn all the timer jobs off, now two of them cannot be turned off, but they don't end up causing much traffic, so no worries there.  With this tool you can search for timer jobs by Name, Title, ID, Schedule and Lock Type.  You can update, updateable properties and click "Update".  You can disable, enable and "Run Now" with just a click of a button!

Sweet!  Download the source code here:  http://bit.ly/4ydtNr

I plan on doing some heavy reverse engineering on some of these bad boys…I encourage you to do the same!

Chris

SharePoint Remote Blog Storage (RBS) – Step by Step Install

I just setup RBS/RBS Filestream on my 2010 farm.  Not so sure about the functionality being pushed to the SQL Server team for this.  I really liked the COM based approach of EBS in 2007 (which is now marked as obsolete, but supposedly still supported – and when I say 'supported' I simply mean it still works – going forward in 2010), but hey, when you don't have budget/time, send it off to someone else that does right?  These steps will get your RBS FILESTREAM sql provider working sorry no screen shots, you only get those in the courses.

So why RBS? What is it you ask?  It stands for Remote Blog Storage.  We'll, lets start with the fact that when you add a document to SharePoint goes into the content database (the binary is serialized into a stream and put into the database, but not really put into the database, but a pointer in sql server row to a set of 8k pages somewhere on disk that represents those files).  All documents go into the content database with out discrimination.  Should there be discrimination?  Yep.  Some people would migrate file shares to sharepoint which would include install isos, some being in the gigabyte size.  These days we can safely say that SQL Server it is a high volume transactional store and yes, it has the ability to store blobs, just not as efficiently as some applications would like.  Because of this, IT depts would say "No" don't put that large file in sharepoint. 

Well of course that leads to confusion as to what goes in and out of SharePoint (the fileshare lived another day in 2007).  In 2007, the SharePoint team introduced EBS which was a COM component based implementation of passing off the BLOB to something else to manage.  RBS is the continuing evolution of this with SQL Server becoming the management point.  Now IT Depts can say, sure throw that into SharePoint!  No confustion, SharePoint is now the hub of everything!  IT Depts can set the size at which RBS kicks in and sends the file somewhere else.  If the RBS becomes obsolete there are ways to migrate back into SharePoint or change the RbsID to migrate to a new store (you will see the new RbsId column in the content database).  Writing an EBS or RBS implementation is NOT easy.  I did an EBS for 2007, and I'll be the first and not last to tell you, the COM interactions, memory management, and file manager components require some thought and patience.  That being said, you will be at the mercy of Microsoft and 3rd parties to create scalable robust EBS/RBS implementations for your sharepoint system.

After publishing this, we had a nice twitter conversation about StoragePoint. It has some awesome RBS connectors!  You should check them out!

The detailed TechNet version of RBS install process is here.  Mine is a more condensed version of the basic steps.

If you like this, be sure to follow me on twitter! More to come!

Exercise 1 – Setup RBS FILESTREAM

Purpose:
        Setting
up RBS FILESTREAM is fairly simple.  In this lab we
will configure RBS in SQL Server and then RBS Client for Sharepoint 2010

Result:           
A content database that uses RBS FILESTREAM

Task 1 – Enable
FILESTREAM on SQL Server

  1. Open SQL Server Configuration
    Manager
  2. Click “Sql Server Services”
  3. Right click “SQL Server
    (MSSQLServer)”, select “Properties”
  4. Click the “FILESTREAM” tab
  5. Check all the checkboxes

  1. Click “Apply”
  2. Open SQL Server Management
    Studio
  3. Connect to the localhost
    server
  4. Right click the instance,
    select “Properties”
  5. Click the “Advanced” tab
  6. For the “Filestream Access
    Level, select “Full access enabled”
  7. Click “OK”
  8. Restart the SQL Server
    service

Task 2 – Prep the
databases

  1. Open a query window, run the
    following sql command:


use [WSS_Content_100]

if not exists (select * from sys.symmetric_keys where
name = N'##MS_DatabaseMasterKey##')create master key encryption by password =
N'Pa$$w0rd'

 

  1. Run the following:


if not exists (select groupname from sysfilegroups where
groupname=N'RBSFilestreamProvider')alter database [WSS_Content_100]

 add filegroup
RBSFilestreamProvider contains filestream

 

  1. Run the following:


alter database [WSS_Content_100] add file (name = RBSFilestreamFile, filename
= 'c:Blobstore') to filegroup RBSFilestreamProvider

 

  1. Expand “Databases”
  2. Right click “Databases”,
    select “New Database”
  3. For the name type,
    “RemoteBlobStorage”
  4. Click “Ok”

Task 3 – Install the
RBS Client

  1. Run d:lab workRBS_x64.msi
    • NOTE: This task is to walk you through the GUI of the install
      program to see the various items that you COULD configure, later you will
      see that this is not necessary as we will re-run in a silent mode for
      SharePoint – product team has also suggested that you NOT run this step as it may add extra settings that could cause problems later!)

  1. Click “Next”

  1. Click “I accept the terms…”
  2. Click “Next”
  3. Click “Next”

  1. Click “Next”

  1. Click “Test Connection”
  2. Click “Next”

  1. Click “Next”
  2. Check the “Show the advanced
    configuration options” checkbox

  1. Click “Next”
  2. Review the settings:

  1. Click “Next”
  2. Review the properties of the
    “Maintainer Task”, this is used to clean up orphaned records that may not
    exist in SharePoint anymore (a user deleted the file in the document
    library).  Check all the checkboxes:

  1. Click “Next”
  2. For this lab, set all the
    logging setting to “Verbose”:

  1. Click “Next”
  2. Click “Install” – AGAIN NOTE – this is for FYI only, you should click "Cancel" if doing this for real
  3. Click “OK” in the task window

Task 3 – Configure
SharePoint 2010

  1. Open a SharePoint Management
    Console
  2. Run the following commands
    from the location of the RBS_X64.msi file (this would need to be run
    against each content database that you want to support RBS):


msiexec /qn /lvx* rbs_install_log.txt /i RBS_x64.msi
TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME="WSS_Content_100"
DBINSTANCE="servername" FILESTREAMFILEGROUP=RBSFilestreamProvider
FILESTREAMSTORENAME=FilestreamProvider_1

 

msiexec /qn /lvx* rbs_install_log.txt /i RBS_x64.msi
DBNAME="WSS_Content_100" DBINSTANCE="servername"
ADDLOCAL="Client,Docs,Maintainer,ServerScript,FilestreamClient,FilestreamServer"

 

  1. Open the rbs_install_Log.txt
    file, at the end of the file, look for:
    • Product: SQL Remote
      Blob Storage — Configuration completed successfully.
  2. You can also check the content database and look for some new tables "mssql*"
  3. Run the following (note this
    only works if the web app has one content database):


$cdb = Get-SPContentDatabase –WebApplication 
http://servername:100

$rbss = $cdb.RemoteBlobStorageSettings

$rbss.Installed()

$rbss.Enable()

$rbss.SetActiveProviderName($rbss.GetProviderNames()[0])

$rbss

 


Task 4 – Test your RBS Provider

  1. On the SQL Server, open the “c:BlobStore”
    folder, this is where your blobs will go by default
  2. Open the team site (http://servername:100)
  3. Add a new document called
    “MyRBSFile” to your document library (make sure it is above 100K as you can set the file size boundary in RBS to move between content db and RBS connectors)
  4. Refresh the c:BlobStore folder,
    you should see a new file in one of the directories
  5. Run the following query
    against your Content database (NOTE: run this against your dev enviornment ONLY so as to not cause any locks on your prod databases):


select ad.SiteId, ad.id, leafname, rbsid

  from alldocs
ad, alldocstreams ads

  where ad.id =
ads.id

  and rbsid is
not null

 

 

 

  1. You should get a query back with information on all
    files that have been submitted to the RBS.
     

Enjoy!
Chris

SharePoint Federated Results

Here are some simple steps to get Federated search results to work in SharePoint 2010.  Its actually really simple, Kudos to the search team.  Note that this sets up a new Bing federated result, there is already one in there, but this walks you through setting up from scratch.

Enjoy!
Chris

Exercise 1 – Setup Federation

Purpose:         Learn to pull in outside search results (federation)
from Bing.

Result:           
Federated search results

Task 1 – Configure your Search Application

  1. Open SharePoint Central
    Administration
  2. Click “Application
    Management”
  3. Click “Manage service applications”
  4. Click “My Search Application”
  5. Click “Federated Locations”
  6. Click “New Location”

  1. For location name, type
    “Bing”
  2. For display name, type “Bing”
  3. For description type,
    federated results from Bing Search provider”
  4. For author, type “Microsoft”
  5. For version type “1.0.0.0”
  6. Leave the Trigger as “Always”
    • NOTE your options,
      prefix and pattern can be applied to the search keywords in deciding to
      send a query to the federated provider
  7. For location type, click
    “OpenSearch 1.0/1.1”
  8. For the query template, type http://www.bing.com/search?q={searchTerms}&format=rss
  9. Note your ability to modify
    the formatting of the results returned from the provider
  10. Note your ability to restrict
    the federated results at a site collection level
  11. Note your ability to set
    credentials for the federated provider
  12. Click “OK’

Task 2 – Set your Search Application

  1. Open Central Administration
  2. Click “Application
    Management”
  3. Click “Configure service
    application associations”
  4. Click “Default”
  5. Check “My Search Application”
  6. Click “Set as default”
  7. Click “OK”

Task 2 – Test your new federation provider

  1. Open your search center (http://servername:115)
  2. Run a search for “SharePoint”,
    you should get no federated results
  3. Click “Site settings->Edit
    Page”
  4. Find the “Top federated
    results” web part
  5. Click “Edit web part”

  1. Select “Bing”
  2. Click “OK”
  3. Run a search for “SharePoint”,
    you should get back a single federated result (the top one):

  1. Click “Site Actions->Edit
    Page”
    • NOTE: you may have to click back to the home page, run a search
      and then click “Site Actions->Edit Page”, there seems to be an issue
      with resending the same query in Beta
  2. Edit the Top Federated
    Results web part, expend “Display Properties”
  3. In “Results Per Page”, set it
    to 3
  4. Click “Ok”, rerun your
    search, you should now see the top 3 results:

Solution Validators – Sandboxed Solutions

So you read my last post and decided that maybe SandBoxed Solutions isn't that great of an idea.  You decided to implement a Solution Validator to limit what your ole developers are doing.

You got the validator created and you installed it, but then realized, its not quite right.  So, you undeploy it right?  Oh, wait, every object that goes in the Object hierarchy table has to have a "public" contructor for deserialization (ie, pulled out of the ConfigDB and turned into memory). Otherwise you get a nice error in Visual Studio and/or Central Admin and you won't be able to retract the solution.

Exception in RefreshCache. Exception message : "MySolutionValidator.MySolutionValidator cannot be deserialized because it does not have a public default constructor."

K, if you followed the little article up there, then you'll notice that particular piece is missing!  Now your stuck…how do you get it out?  Well, you gotta run a command against the config database: NOTE:  This is a highly dangerous operation, if you mess it up, your Farm gets deleted!

delete from Objects
where properties like '%MySolutionValidator%' –or to be more safe, the full assembly name

You could also run the following stsadm command provided you do the query to find the id in the Config database:

select id, properties from Objects
where properties like '%MySolutionValidator%'

STSADM -o deleteconfigurationobject -id “id retrieved from object table”

This will clear the object and the retract will succeed.  This will be the case for ANYTHING that goes into the object hierarchy table.

Chris

 

Missing Server Side Dependencies – 8d6034c4-a416-e535-281a-6b714894e1aa

So what is this you ask?  Well, I did a little digging, I watched the Timer Job and the query it sent ( to the content database of the central admin site):

SELECT tp_WebPartTypeId, COUNT(1), tp_Assembly, tp_Class
FROM AllWebParts (NOLOCK)
WHERE tp_WebPartTypeId IS NOT NULL GROUP BY tp_WebPartTypeId, tp_Assembly, tp_Class

You get back a result set that has a null for the tp_Assembly column for the web part. What is this web part you ask, well it is the Microsoft.Office.Server.Search.WebControls.SearchTopologyView web part
in the Microsoft.Office.Server.Search, Version=14.0.0.0,
Culture=neutral, PublicKeyToken=71e9bce111e9429c
assembly.

If you do a query to see where these 6 instance are:

select *
from AllWebParts
where tp_WebPartTypeId = '8D6034C4-A416-E535-281A-6B714894E1AA'

You will see that the web part exists on two pages:

  • SearchAdministration.aspx
  • SearchFarmDashboard.aspx

Open those pages, notice…It DOES exist!

Now, here is the funny thing – rerun the queries.  As soon as you open those pages, the databsae gets updated and the error will go away.  Weird!!!

Enjoy!
Chris

SharePoint 2010 User Profile Properties (SubType) – Error

When creating a custom User Profile Property, be sure to check the "Default User Profile Subtype" checkbox.  If you don't you won't see the property on the manage properties page and won't be able to get to it through the UI.

However, I figured a way to get to it…just paste in the browser (to get your appid just click on another property to edit, then change the name query string):

http://sharepoint2010:20974/_layouts/EditProperty.aspx?Name=[PROPRETYNAME]&IsSection=False&ProfileType=&ApplicationID=31948422%2D08be%2D4c84%2D8e9c%2D40d3bb10970f

And you will be able to get to it and check the checkbox

Another issue, when you click the "Add new mapping", if you don't select anything, it will add the "Select Attribute" to your mappings, this is obviously wrong and will not  make your ForeFront Sync happy.

Also note that after adding a  new property, your log will get several "Sync" errors for each site collection saying you don't have that property in the site!

[UPDATE] – In RTM, the checkbox will be checked by default…woohoo, now you just gotta hope the admins don't uncheck it!

Enjoy!
Chris