Thursday, June 10, 2010

Viewing SharePoint 2010 sites on Windows Server 2008 R2

Running SharePoint 2010 server on a Windows 2008 R2 server seems to be a sensible thing to do.  Well at least I thought that until I tried to locally access SharePoint sites on that server via IE.

You will find that on Windows Server 2008 R2, you will be prompted for authentication three times and the page will fail to load. This is because R2 uses the new SPNEGO2 implementation:

 (You may ask why would you need to access sites locally on the server? - well for things like Visual Studio development for SharePoint you must actually develop and run them on your development SharePoint server)

 The solution to this is to make sure that Web Applications you need to access on a Windows 2008 R2 server are setup with the following:

a) a SPN for each Web Application URL
This consists of using the http url of the Web Application and adding it to the Service Principle Name (SPN) of the AD account that the Web application pool runs as. eg.  with a Web Application called http://home.company.com which runs in an IIS AppPool called MySPSites that runs under the security account of mydomain\SPServices.
SETSPN.exe -S HTTP/home.company.com mydomain\SPServices
  • (make sure you use an administrative CMD window)
  • (this may take a little while on a large AD as it first checks for any duplicate SPNs and if it doesnt find one then adds it to the account).
and (b) For the URL or (URL plus port number) of the Web Application you wish to access on the Windows 2008 R2 Server, you must set either the Default security Zone, or an extended one to have IIS Authentication set to use Kerberos security.
You can do this either on intially setting up the Web Application with Kerberos, or if you need to use different IIS Authentication types for your Default Zone Web App then, after you have created it, extend it using either a different URL or port number.  You can choose a different security Zone when you extend the Web App, or, unlike SharePoint 2007, you can change the IIS Authentication Settings at any time from the Sharepoint Admin console via -> Central Administration->Security->Specify Authentication Provider.
I had hoped that I would only need to carry out step (a) as eluded to in the Harbar.net article but thus far I havnt managed to avoid step (b)
References:

Wednesday, June 09, 2010

SharePoint Technology Conference | October 20-22, 2010 | Boston

An interesting Sharepoint Conference to consider for October
SharePoint Technology Conference October 20-22, 2010 Boston

Access Web Services : form filtering and sorting

If you setup a form based on a table source and then add in the forms properties to sort and filter, when you add this form to a Navigation page it completely disregards what you have entered in the forms properties and  just uses the default sort for the table with all values - Brilliant Microsoft!



Filter and Order By Properties  get ignored.


So to get around this for sorting you need to write a query on your table that has the data sorted in the format you require.  Then change the form to use the query instead of the table and that’s sorting sorted out.

But what about filtering?

Well on the tab for a navigation page there is a property called "Navigation Where Clause"  if you put your where statement in there Microsoft actually uses this filter in the way you would expect and doesn’t ignore it as before.  Wonderful!

Navigation Where Clause's do  work

Friday, June 04, 2010

Access Web Services : filtered field lookup lists


One of the key advantages I thought of for using Access Web Services in SharePoint is for populating fields with lookups. Whilst you can do this in SharePoint using the whole list as a lookup there is no way to filter that list. So if you want to filter out all assignments which are marked with a status of complete then you are stuffed!

 
But with Access Web Services I thought you could use a query for the lookup so this would solve the problem. BUT NO you cant use queries for table field lookups using Access Web Services ! As with most Microsoft technologies its two steps forward one back - why do they do this!?! However I have found a workaround which uses forms to filter the lookup and the detail is at the end of this article.

 
Firstly
if you create a new field and follow the diagrams below you see that lookups from queries are greyed out (why Microsoft !?!). Worse than that, for a new table , you will not see any of the existing tables either. To see the existing tables first save your new table and then fully Sync it to SharePoint. Only then will you get a full list of the tables you can use for lookups.

 



Lookup query workaround

Firstly create a form which includes the lookup field you have defined. As expected you will see that it returns all values from the table. Then make sure your in "Layout View" and highlight the field and bring up the property sheet. In the properties you will see a value for row source and its SQL !! If you update this by either carefully updating the text or using the query editor (much safer) you can put your "where clauses" into this query. And bingo it works on both the local access and on SharePoint. Hurrrah!








 

Tuesday, June 01, 2010

SharePoint 2010 : State Service issues & problems


I built two SharePoint Enterprise servers in separate farms from scratch using different farms and SQL servers. The first is a development machine to try things out on and the second is the production box.

As with all the best MVP advice you should not use the configuration wizard but manually create each service and for the most part Ive done this successfully, however when we started trying to use Infopath or Reports in Access Web Services we started getting some odd errors such as:

The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service.

And

This report failed to load because session state is not turned on.

This was happening on both the production and development servers which was most odd.

Looking in SharePoint service applications there was no reference to the "State Service" on one of the servers and one line item for "State Service" on the other. Also most odd as both servers had been setup in the same way.

 There is no way to create the State service from the new service application menu as it should have been setup from the SharePoint install, so you either have to use the Configuration wizard or PowerShell.

 In the case of there not being any reference to a State Service I ran a powershell command to create a state service database and then ran the Configuration Wizard with everything possible unchecked apart from the State Service. The powershell command to create the database is "

New-SPStateServiceDatabase" See TechNet for more details

After an IISReset the errors seemed to clear and all was well with one of the servers.

For the other server the same process wasn't an option as the Configuration Wizard already had the State Service Checked. So using Powershell I manually created a State Service Application and State Service Proxy and enabled it all using the commands


New-SPStateServiceApplication
New-SPStateServiceDatabase
New-SPStateServiceApplicationProxy
and
Enable-SPSessionStateService

(See http://technet.microsoft.com/en-us/library/ee890113.aspx)

 However after doing all of this successfully and being able to see the State Application and Proxy in the SharePoint Central administration list of service applications the error s still persisted. So using the SharePoint service application screen I deleted the first State Service and the new State Service Proxy and State Service which I had created. This allowed me to run the configuration wizard with only the State Service tick box checked and after another iisreset voila !

Others have also seen this issue - see

Misconfiguration of the MOSS State Service
Pasted from <http://social.msdn.microsoft.com/Forums/en/sharepointworkflow/thread/521db715-0d76-49ce-be36-7c37cfb8026f>