3 Degrees of SharePoint Development
http://www.davemilner.com
3 Degrees of SharePoint Development

SharePoint w/SP1 Prerequisite Installer Errors on KB976462

I ran across a strange error today for the first time installing the SharePoint bits on a new server.  Basically I was using the MSDN package which contains SharePoint Server 2010 SP1 – build 759775.  I was installing it on a Windows 2008 R2 Server with SP1 installed.

Problem

Normally SharePoint’s pre-requisite installer installs everything flawlessly.  However, today, it failed trying to install KB976462 – the Hotfix for Microsoft Windows.  The error message wasn’t particularly helpful – just a failed to install error –  Install process returned (-2145124329) as seen in the below image:

Step1

After spending of course too much time searching for a fix, I finally ran across this KB article:

http://support.microsoft.com/kb/2581903

Basically, the bottom line is that Windows 2008 R2 Server SP1 already has that Hotfix included in the service pack, so the SharePoint Prerequisite installer is failing on an attempt to install it.

Fix

The fix is simple – just Run the SharePoint PreRequisite Installer again, and it will detect that KB976462 is installed, skip it, and install all the rest of the prerequisites.

Results look like this – much better:

Step3

Questions

Of course this brings up as many questions as it answers:

1.  Why can’t the SharePoint PreReq installer recognize the Hotfix is already installed on the first pass, but can recognize this on the second pass?

2.  Will Microsoft fix this?  Patch the PreReq installer in a future CU or SP?

3.  Shouldn’t standard error trapping in software not prevent all the downstream steps in a process from happening?

3.  Why, why, why?

But, such is life in technology. 

How to Set up Database Mirroring in SQL Server 2008 R2 for SharePoint 2010 Step by Step

This blog post has the goal of being able to coach you through setting up database mirroring for SQL Server 2008 R2 and SharePoint 2010 as a complete package.  If you follow the steps carefully step by step then you will be able to mirror your whole 2010 environment.   Screen shots of SQL Management Studio and Central Admin are included, as well as T-SQL scripts and PowerShell scripts necessary.

Prerequisites

There are several prerequisites to set up before undertaking setting up mirroring.  They include:

  1. Run ALL SQL Server instances with a domain account.  I set up SP2010\SPSQL for this.   Any domain service account will do.
  2. Principal, Mirror, and Witness are need to be running same version of SQL Server.  In my instances I have the Principal and Mirror running SQL Server 2008 R2 and the witness server running SQL Server 2008 R2 Express Edition.
  3. Your SQL Servers you are using for a Principal and Mirror need to have 1ms latency between them.
  4. They also should have 1GB/s throughput between them.   These two measurements will ensure that when your farm is experiencing heavy use, it won’t falsely detect a failed Principal and fail over.

Ready to Go

First, shut down your SharePoint servers so they will not interact with the databases.

Start to manually set up mirroring for one of your SharePoint databases.  The reason to do this is to take advantage of all the wizards in setting up endpoints and other tasks like this.  The other reason is that the configuration wizard once you are finished shows you the exact values you need to put into SQL scripts later on in this article as endpoints. 

An endpoint looks like this:  TCP://SQL1.sp2010.local:5022

Once we do one database we can script the rest.   I chose the WordConversion database for this as it is practically not used, so very small, and at the end of the list:

image

NOTE:  You cannot mirror the following databases:   SP2010_SharePoint_People_Sync, SP2010_SharePoint_Analytics_Stager1.  It is also not recommended to mirror the SP2010_SharePoint_Usage database.  As a matter of fact, if you try to mirror the Usage database, you will get the following error:

image

Databases that are intended for transitory storage only are usually configured not to use the full recovery model for backups, as they are not needed for DR.  I used the names of MY databases.

SQL Management Studio Mirroring Configuration Wizard

I right-click the database, select “Tasks->Mirror…”

image

The next window shows the Mirroring Wizard:

image

Click “Configure Security”

image

Next->

image

Select “Yes” for including a witness server.  This is so we can take advantage of Asynchronous Mirroring with Automatic Failover.  Next->

image

Yes we want to save the security configuration on all 3 of the instances – Principal, Mirror, and Witness.

image

Set up the Principal first.  My principal is SQL1. 

image

Next is SQL 2 which is my Mirror instance.

The next service is my Witness Instance.  to enable this, I needed to start the SQL Browser Service on my SQL Express Witness instance as follows:

image

I also needed to ensure that TCP/IP was enabled as a protocol

image

Now I can go and configure the Witness Instance:

image

Next we will specify service accounts:

image

Now the wizard will set up all of the items:

image

Click Finish. 

image

Endpoints re created on all 3 instances. 

image

Select start mirroring  – we still need to set up all the accounts and restore  backup, but if you don’t you’ll lose the endpoints setup.  Copy the values from those 3 endpoint setups as we will need them.   You don’t REALLY have to do this if you know the format, but to me setting up one by way of the Configuration Wizard helps me to ensure that I can connect to each of the SQL instances and that my endpoints are accurate.   It is a backstop check to ensure what I’m going to do for the rest of the databases via T-SQL is accurate.

Now we will go back and transfer logins. 

Run the following SQL script to generate logins necessary on the MIRROR:

SELECT
'create login [' + p.name + '] ' +
case when p.type in('U','G') then 'from windows ' else '' end +
'with ' +
case when p.type = 'S' then 'password = ' + master.sys.fn_varbintohexstr(l.password_hash) + ' hashed, ' +
'sid = ' + master.sys.fn_varbintohexstr(l.sid) + ', check_expiration = ' +
case when l.is_policy_checked > 0 then 'ON, ' else 'OFF, ' end + 'check_policy = ' + case when l.is_expiration_checked > 0 then 'ON, ' else 'OFF, ' end +
case when l.credential_id > 0 then 'credential = ' + c.name + ', ' else '' end
else '' end +
'default_database = ' + p.default_database_name +
case when len(p.default_language_name) > 0 then ', default_language = ' + p.default_language_name else '' end

FROM sys.server_principals p
LEFT JOIN sys.sql_logins l
ON p.principal_id = l.principal_id
LEFT JOIN sys.credentials c
ON  l.credential_id = c.credential_id
WHERE p.type in('S','U','G')
AND p.name <> 'sa'

This script’s output generates the T-SQL input that we will need to run on the MIRROR

create login [##MS_PolicyEventProcessingLogin##] with password = 0x01005e7e88007a0c23e5bef893202e8e76167992f6d5acc53a98 hashed, sid = 0x4eaf544d095570419cf280e6c9d103a6, check_expiration = ON, check_policy = OFF, default_database = master, default_language = us_english
create login [##MS_PolicyTsqlExecutionLogin##] with password = 0x0100d581c668f91c13174c84b608b1337c6635533e1ac36c0632 hashed, sid = 0x014ea8886b841c4ca1f7ed32489bbf62, check_expiration = ON, check_policy = OFF, default_database = master, default_language = us_english
create login [NT AUTHORITY\SYSTEM] from windows with default_database = master, default_language = us_english
create login [NT SERVICE\MSSQLSERVER] from windows with default_database = master, default_language = us_english
create login [SQL1\Dave] from windows with default_database = master, default_language = us_english
create login [NT SERVICE\SQLSERVERAGENT] from windows with default_database = master, default_language = us_english
create login [SP2010\dave] from windows with default_database = master, default_language = us_english
create login [SP2010\spadmin] from windows with default_database = master, default_language = us_english
create login [SP2010\SPFarm] from windows with default_database = master, default_language = us_english
create login [SP2010\SPMySitesAppPool] from windows with default_database = master, default_language = us_english
create login [SP2010\SPSites1AppPool] from windows with default_database = master, default_language = us_english
create login [SP2010\SPAppPool] from windows with default_database = master, default_language = us_english
create login [SP2010\SPSearch] from windows with default_database = master, default_language = us_english
create login [SP2010\SPSearchAppPool] from windows with default_database = master, default_language = us_english
create login [SP2010\SPUserCode] from windows with default_database = master, default_language = us_english
create login [SP2010\SPSearchCrawl] from windows with default_database = master, default_language = us_english
create login [sp2010\spsql] from windows with default_database = master, default_language = us_english

Run this script on the MIRROR to duplicate all the logins from your PRIMARY.

Next, run the following script

--use master
DECLARE @name VARCHAR(4000) -- database name 
DECLARE @path VARCHAR(4000) -- path for backup files 
DECLARE @fileName VARCHAR(4000) -- filename for backup 
DECLARE @logfileName VARCHAR(4000) -- logfilename for backup 
DECLARE @fileDate VARCHAR(20) -- used for file name
declare @sql nvarchar(4000)
 
 
SET @path = 'C:\Backups\' 

SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112)

DECLARE db_cursor CURSOR FOR 
SELECT name
FROM master.dbo.sysdatabases
WHERE name NOT IN ('master','model','msdb','tempdb') 
--WHERE name NOT IN ('master','model','msdb','tempdb',’INCLUDE YOUR DB’s)'

CREATE TABLE #TEMPRESTORE
(
CMD VARCHAR(400)
)
OPEN db_cursor  
FETCH NEXT FROM db_cursor INTO @name;
      
WHILE @@FETCH_STATUS = 0  
BEGIN  
       SET @fileName = @path + @name + '_' + @fileDate + '.BAK' 
       SET @logfileName = @path + @name + '_' + @fileDate + '_Log.BAK'     
      
        
        SET @sql = 'ALTER DATABASE "' + @name + '" SET RECOVERY FULL'
        exec sys.sp_executesql @sql;

   
        BACKUP DATABASE @name TO DISK = @fileName with format;
        BACKUP log @name TO DISK = @logfileName with format;
       
        INSERT INTO #TEMPRESTORE VALUES ('RESTORE DATABASE "'+@name+'"
       FROM DISK = '''+@fileName+''' WITH NORECOVERY')
       INSERT INTO #TEMPRESTORE VALUES ('go')
       INSERT INTO #TEMPRESTORE VALUES ('RESTORE LOG "'+@name+'"
       FROM DISK = '''+@logfileName+''' WITH NORECOVERY')
         INSERT INTO #TEMPRESTORE VALUES ('go')
       FETCH NEXT FROM db_cursor INTO @name  
END  

CLOSE db_cursor  
DEALLOCATE db_cursor
SELECT * FROM #TEMPRESTORE
DROP TABLE #TEMPRESTORE

The output of this script needs to be saved as well as the actions that it takes.  Here is the output from my execution of the T-SQL, which we will run on the MIRROR:

RESTORE DATABASE "SP2010_SharePoint_ConfigDB"         FROM DISK = 'C:\Backups\SP2010_SharePoint_ConfigDB_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_ConfigDB"         FROM DISK = 'C:\Backups\SP2010_SharePoint_ConfigDB_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "SP2010_SharePoint_CentralAdmin_Content"         FROM DISK = 'C:\Backups\SP2010_SharePoint_CentralAdmin_Content_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_CentralAdmin_Content"         FROM DISK = 'C:\Backups\SP2010_SharePoint_CentralAdmin_Content_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "SP2010_SharePoint_MySites_Content1"         FROM DISK = 'C:\Backups\SP2010_SharePoint_MySites_Content1_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_MySites_Content1"         FROM DISK = 'C:\Backups\SP2010_SharePoint_MySites_Content1_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "SP2010_SharePoint_Sites_Content1"         FROM DISK = 'C:\Backups\SP2010_SharePoint_Sites_Content1_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_Sites_Content1"         FROM DISK = 'C:\Backups\SP2010_SharePoint_Sites_Content1_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "SP2010_SharePoint_State"         FROM DISK = 'C:\Backups\SP2010_SharePoint_State_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_State"         FROM DISK = 'C:\Backups\SP2010_SharePoint_State_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "SP2010_SharePoint_SessionState"         FROM DISK = 'C:\Backups\SP2010_SharePoint_SessionState_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_SessionState"         FROM DISK = 'C:\Backups\SP2010_SharePoint_SessionState_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "SP2010_SharePoint_SecureStore"         FROM DISK = 'C:\Backups\SP2010_SharePoint_SecureStore_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_SecureStore"         FROM DISK = 'C:\Backups\SP2010_SharePoint_SecureStore_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "SP2010_SharePoint_Search"         FROM DISK = 'C:\Backups\SP2010_SharePoint_Search_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_Search"         FROM DISK = 'C:\Backups\SP2010_SharePoint_Search_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "SP2010_SharePoint_MetaData"         FROM DISK = 'C:\Backups\SP2010_SharePoint_MetaData_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_MetaData"         FROM DISK = 'C:\Backups\SP2010_SharePoint_MetaData_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "SP2010_SharePoint_People_Profile"         FROM DISK = 'C:\Backups\SP2010_SharePoint_People_Profile_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_People_Profile"         FROM DISK = 'C:\Backups\SP2010_SharePoint_People_Profile_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "SP2010_SharePoint_Search_CrawlStore1"         FROM DISK = 'C:\Backups\SP2010_SharePoint_Search_CrawlStore1_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_Search_CrawlStore1"         FROM DISK = 'C:\Backups\SP2010_SharePoint_Search_CrawlStore1_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "SP2010_SharePoint_Search_PropertyStore1"         FROM DISK = 'C:\Backups\SP2010_SharePoint_Search_PropertyStore1_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_Search_PropertyStore1"         FROM DISK = 'C:\Backups\SP2010_SharePoint_Search_PropertyStore1_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "SP2010_SharePoint_People_Social"         FROM DISK = 'C:\Backups\SP2010_SharePoint_People_Social_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_People_Social"         FROM DISK = 'C:\Backups\SP2010_SharePoint_People_Social_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "SP2010_SharePoint_WordConversion"         FROM DISK = 'C:\Backups\SP2010_SharePoint_WordConversion_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_WordConversion"         FROM DISK = 'C:\Backups\SP2010_SharePoint_WordConversion_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "SP2010_SharePoint_Analytics_Warehouse"         FROM DISK = 'C:\Backups\SP2010_SharePoint_Analytics_Warehouse_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_Analytics_Warehouse"         FROM DISK = 'C:\Backups\SP2010_SharePoint_Analytics_Warehouse_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "SP2010_SharePoint_BCS"         FROM DISK = 'C:\Backups\SP2010_SharePoint_BCS_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_BCS"         FROM DISK = 'C:\Backups\SP2010_SharePoint_BCS_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "SP2010_SharePoint_FoundationSearch"         FROM DISK = 'C:\Backups\SP2010_SharePoint_FoundationSearch_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "SP2010_SharePoint_FoundationSearch"         FROM DISK = 'C:\Backups\SP2010_SharePoint_FoundationSearch_20111110_Log.BAK' WITH NORECOVERY
go
RESTORE DATABASE "PerformancePoint Service Application_2757dc3dcb96455799c3e33c55f40b5d"         FROM DISK = 'C:\Backups\PerformancePoint Service Application_2757dc3dcb96455799c3e33c55f40b5d_20111110.BAK' WITH NORECOVERY
go
RESTORE LOG "PerformancePoint Service Application_2757dc3dcb96455799c3e33c55f40b5d"         FROM DISK = 'C:\Backups\PerformancePoint Service Application_2757dc3dcb96455799c3e33c55f40b5d_20111110_Log.BAK' WITH NORECOVERY
go

Next, copy all of the files from your C:\Backups directory on the PRINCIPAL server over to the C:\Backups directory on the MIRROR server.

Run the T-SQL generated by your script which should look similar to the above T-SQL on the MIRROR.  After this executes we see all of the restored DB’s in recovery mode:

 

image

Now we need to set the MIRROR partners, first on the MIRROR, then on the PRINCIPAL.  Execute the following T-SQL script on the MIRROR:

NOTE:  For the first run make sure the @mirorendpoint variable is pointing to your PRINCIPAL instance.

--use master
DECLARE @name VARCHAR(4000) -- database name 
declare @sql nvarchar(4000)
Declare @mirrorendpoint varchar(4000)
Declare @witnessendpoint varchar(4000)

set @mirrorendpoint ='TCP://SQL1.sp2010.local:5022'
set @witnessendpoint ='TCP://SQL-WITNESS.sp2010.local:5022'

DECLARE db_cursor CURSOR FOR 
SELECT name
FROM master.dbo.sysdatabases
--WHERE name NOT IN ('master','model','msdb','tempdb') 
--WHERE name NOT IN ('master','model','msdb','tempdb','AdventureWorks','AdventureWorksDW','AdventureWorksDW2008','AdventureWorksLT','AdventureWorksLT2008','User Profile Service Application_SocialDB_e5c7c51ed6cc400a93cfbc23bca86fed','User Profile Service Application_SyncDB_4e161aa1381e42e8a7844d99165ec79b','WSS_Logging');
WHERE name NOT IN ('master','model','msdb','tempdb','AdventureWorks','AdventureWorksDW','AdventureWorksDW2008','AdventureWorksLT','AdventureWorksLT2008','SP2010_SharePoint_Analytics_Stager1','SP2010_SharePoint_People_Sync','SP2010_SharePoint_Usage');

OPEN db_cursor  
FETCH NEXT FROM db_cursor INTO @name;
      
WHILE @@FETCH_STATUS = 0  
BEGIN  
         --At HOST_B, set the server instance on HOST_A as a partner (principal server): - repeat for all DBS
     
        
        SET @sql = 'ALTER DATABASE "' + @name + '" SET PARTNER = '''+@mirrorendpoint+''''
        print @sql
        print 'GO'
 
       
FETCH NEXT FROM db_cursor INTO @name  
END  

CLOSE db_cursor  
DEALLOCATE db_cursor

 

This script will generate the output to run on your MIRROR instance as follows:

ALTER DATABASE "SP2010_SharePoint_ConfigDB" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "SP2010_SharePoint_CentralAdmin_Content" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "SP2010_SharePoint_MySites_Content1" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "SP2010_SharePoint_Sites_Content1" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "SP2010_SharePoint_State" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "SP2010_SharePoint_SessionState" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "SP2010_SharePoint_SecureStore" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "SP2010_SharePoint_Search" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "SP2010_SharePoint_MetaData" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "SP2010_SharePoint_People_Profile" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "SP2010_SharePoint_Search_CrawlStore1" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "SP2010_SharePoint_Search_PropertyStore1" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "SP2010_SharePoint_People_Social" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "SP2010_SharePoint_WordConversion" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "SP2010_SharePoint_Analytics_Warehouse" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "SP2010_SharePoint_BCS" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "SP2010_SharePoint_FoundationSearch" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO
ALTER DATABASE "PerformancePoint Service Application_2757dc3dcb96455799c3e33c55f40b5d" SET PARTNER = 'TCP://SQL1.sp2010.local:5022'
GO

Run this on the MIRROR.

Next go back and change the @mirrorendpoint variable in the above T-SQL script to point to your MIRROR instance.  Then run the resulting script on the PRINCIPAL.

Next, on the PRINCIPAL, go back and change the statement in the cursor from SET PARTNER to SET WITNESS.  Then change the @mirrorenpoint variable to @witnessendpoint.  Run the script to generate output, and run the output on the PRINCIPAL instance.

The databases should be mirrored now.  You can tell this by looking at the state of the databases on the MIRROR instance – they will look something like this:

image

Likewise the PRINCIPAL instance will show a mirrored state:

image

Go back to your SharePoint farm and add the failover database instance to point to the MIRROR server.  We can start up our SharePoint server again now that the databases are mirrored.

You can do this with the following Powershell.  NOTE:  Replace the –inotmatch statements with the names of the specific databases you do not want to point to your MIRROR 

Get-SPDatabase |?{$_.Type.ToString() -inotmatch "SP2010_SharePoint_Analytics_Stager1" 
-and $_.Type.ToString() -inotmatch "SP2010_SharePoint_People_Sync" -and $_.Type.ToString() 
-inotmatch "SP2010_SharePoint_Usage"}| %{$_.AddFailoverServiceInstance("SQL2");$_.Update()}

You can confirm this worked by going into Central Administration and selecting manage Content Databases under Application Management.  Select the Content Database, and you should see the Failover Database Server value populated.

 
image

This should serve are a step by step extensive guide on exactly how to set up your SharePoint servers for Database Mirroring.

Now you are all ready to perform the test of this by nuking your PRIMARY and watching the fun begin!!!

Credits

I would like to thank two of my classmates from the MCM (R7) program for SharePoint 2010, Aaron Saikovski and Alex Bacchin for some of the content and the original T-SQL scripts for this. 

SharePoint 2010 SP1 Released–Office 365 Launch

Yesterday was a pretty big day for Microsoft, SharePoint, and the cloud.  SharePoint 2010 Service Pack 1 as well as the SP1 for many related product groups all released, and Office 365 officially was released to market.  

Since these topics are already given great coverage by many bloggers, I thought I would take the time to link-list a number of valuable blog posts covering these items.  I’ll also fill in some detail where I didn’t see a lot of coverage.

For a package list of the released service packs across the stack for SP1, see - http://support.microsoft.com/kb/2510766

SharePoint 2010 SP1 

Office 2010 SP1

  • Office 2010 – SP1 – available for download - http://support.microsoft.com/kb/2460049.  In this are listed many of the fixes for Office 2010 including these highlights:
    • OneNote 2010 – new Open from Web feature allowing for opening a OneNote notebook from Windows Live SkyDrive (plus several fixes around that feature, logging in on synchronizing
    • Excel 2010 – performance fixes
    • PowerPoint 2010 – UsePresenterView – change in default behavior to show slideshow on secondary monitor and notes on primary monitor
    • Access 2010 – new options to integrate community content in Application Parts

Also of note with the Office 2010 SP1 – there are fixes to a number of other programs that are SharePoint related like SharePoint Designer 2010, PerformancePoint Dashboard Designer, SharePoint Workspace, and Microsoft Project.

Office Web Applications SP1

  • Office Web Apps SP1 - http://support.microsoft.com/kb/2460073 – offers the following improvements:
    • OpenDocument Format (ODF) support.
    • Google Chrome support
    • Attachment viewing for Office 365
    • Print Word docs from Edit and View modes, as well as print PowerPoint
    • Insert Charts in Excel

Office 365

Those are a few linked resources for you to enjoy!  The SP1 family as well as the introduction of Office 365 really marks a distinct milestone in feature upgrades for the SharePoint family and product stack.  I’m excited to get installations going and to dive in.

COSPUG–Colorado Springs–Enterprise Services Farms

Last night on 5/11/2011 I presented a session to the local COSPUG group on Enterprise Services Farms.

Abstract:

With the new Service Application model additional possibilities are opened up for publishing and consuming individual service applications across farms. This architectural design has previously been thought to only be of use in the very largest SharePoint deployments. However, with the ease of setting up publishing and consuming farms this pattern offers many more possibilities. In this session we will examine setting up services in a Service Farm environment

I promised to upload my content for the talk (PowerPoint, PowerShell scripts) to my blog.  The PowerPoint contains an overview of services farms as well as step by step actions to set them up.  The PowerShell script is a script for exchanging trust certificates as well as a script for publishing the services.

You can access all of that here.

SharePoint 2010, CBA and ADFS 2.0

Identity

Identity is a common problem for connected systems.  Who am I? (AuthN) and What should I be able to do? (AuthZ) are fundamental questions to answer for every software solution.  In the world of SharePoint 2010, Claims Based Authentication (CBA) and Active Directory Federation Services (ADFS) 2.0 tie in to those questions in unique ways.

I am going to talk about these topics in a series of blog posts. This post is Part 1.   My goal is to not only cover the “what” and “how” of getting these technologies working in a SharePoint 2010 environment (which will include Office 365), but to explain a little bit about what they represent, what the business advantages are of using them, and how they work together between themselves and with other external systems. 

Claims Based Authentication

Claims Based Authentication (CBA) is a new feature bundled into SharePoint 2010.   Microsoft Technet literature says of CBA:

“SharePoint Foundation 2010 incorporates a new authentication model that works with any corporate identity system, including Active Directory Domain Services, LDAP-based directories, application-specific databases, and user-centric identity models.” - http://technet.microsoft.com/en-us/sharepoint/ee518670.aspx

The idea behind CBA is to make authentication and SharePoint easier by implementing some standards that are emerging surrounding identity, such as SAML, WIF, and the WS-* standards.  CBA is seen for the first time in SharePoint 2010 in all versions of the product including the free Foundation product.   CBA offers the ability to do things like authenticate against Windows LiveID, other systems such as OpenID, LDAP based directories, or open source federated authentication systems such as Shibboleth implemented in other operating systems and on other technology stacks.

Why is this important?

CBA is identity’s road into the future.   While easily-set-up examples aren’t as abundant out of the box now, and while SharePoint 2010 still supports the tried and true authentication methods of NTLM and Kerberos a lot more flawlessly than the CBA implementation in this version, the world of identity is marching on towards open standards based systems, and CBA is directly on that road.  Standards allow authentication to bridge vendors and operating systems, and in a connected world of cloud computing this becomes more and more important.

What is ADFS 2.0 and where does it fit in?

Active Directory Federation Services (ADFS) 2.0 is Microsoft’s toolset to federate identity.  Technet literature states:

“Active Directory Federation Services (AD FS) 2.0 helps simplify access to applications and other systems with an open and interoperable claims-based model. The AD FS 2.0 platform provides a fully redesigned Windows-based Federation Service that supports the WS-Trust, WS-Federation, and Security Assertion Markup Language (SAML) protocols.” - http://technet.microsoft.com/en-us/library/adfs2(WS.10).aspx

OK, you say, but what does that mean?  Maybe these words to you are only concepts currently.  Maybe you’ve read through a lot of content on Technet and ADFS 2.0 doesn’t seem to simplify a whole lot.  It’s a lot more complicated than just setting up SharePoint with NTLM or Kerberos, for example.

While that may be a fair criticism or assessment right now, let’s go back up to that big picture for a moment.  What is federation in general?  The most common definition is “the act of federating or uniting in a league”  This presents the general idea, and the technical definition also clarifies further – “A federation is multiple computing and/or network providers agreeing upon standards of operation in a collective fashion”.  While federation in identity is still in its beginning stages, this is the method that absolutely will need to be used to connect systems based upon disparate technologies. 

We see federation in a couple places starting to creep into SharePoint.  One of the first is in Search – where we can start to bring in results from crawling other non-SharePoint sources and have them produce similar results to searching SharePoint sources.

The second place federation is coming in is right here in the identity world.  ADFS 2.0 works in the most simple fashion as a claims producer and a claims consumer.  

As a claims producer (termed “claims provider role” in ADFS terminology), ADFS 2.0 can authenticate a user against a back-end claims store and issue a certificate that can be passed along to an application for identity purposes.

As a claims consumer (termed “relying party role” in ADFS terminology), ADFS 2.0 can process and trust claims from other claims providers.  After validating the claim, it can reaffirm the claim to its relying parties (such as a SharePoint 2010 application).

What kind of back-end systems can ADFS 2.0 help me authenticate against?

ADFS 2.0 as of this writing has a number of white papers that highlight example implementations of federated authentication against several back-end stores, including IBM Tivoli, Windows Azure, SharePoint 2010, PingFederate, the Microsoft Office 365 beta, Oracle Identity Federation, Shibboleth 2.0, and CA Federation Manager.   As you can notice, several of these represent vastly different technology stacks.  More details of this can be found here:  http://technet.microsoft.com/en-us/library/adfs2-step-by-step-guides(WS.10).aspx

What scenarios could ADFS 2.0 help me in my SharePoint 2010 environment?

Goals for ADFS 2.0 in general can include the following:

  • Provide your AD Users access to your claims aware applications
  • Provide your AD Users access to applications and services in other organizations
  • Provide other organizations users access to your applications

These goals maps to the following ADFS 2.0 Designs:

  • Web Single Sign-On (SSO)
  • Federated Web Single Sign-On (SSO)

The general goal of providing your AD users access to your claims aware applications when you consider SharePoint doesn’t really gain us a whole lot.  Our AD users ALREADY have access to SharePoint through NTLM and Kerberos. 

However, from a SSO perspective where you can provide your users access to other applications and services in another organization has a unique SharePoint application:  Office 365 uses ADFS 2.0 to provide SSO capabilities and you can utilize your on premises ADFS 2.0 implementation to tie into this, as highlighted in the Beta here:  http://onlinehelp.microsoft.com/en-us/Office365-enterprises/ff652540.aspx 

Another key point as it pertains to SharePoint is that you can authenticate users that are external to your organization, or external to your corporate intranet through ADFS 2.0 and provide them access to your SharePoint 2010 environments through CBA.

So in conclusion, this is an introduction to the topics of SharePoint 2010, Claims Based Authentication (CBA) and Active Directory Federation Services (ADFS) 2.0

Stay tuned for further details of how these work together in future blog posts.

MSDN SharePoint Event–Slides and Code

Yesterday I assisted Paul Yuknewicz, Lead PM for Visual Studio SharePoint tools, in putting on a half-day event at the Denver Microsoft Office on SharePoint.

As promised, my slides from the event and source code are available.  You may download them at the link below. 

To all the attendees – thanks for your support and for your interest in SharePoint.  If you are interested in further local SharePoint involvement and free training in the Colorado area, please visit our Colorado SharePoint community at www.cospug.com.

I am Published! Pro ASP.NET SharePoint 2010 Solutions

This is kind of an exciting milestone.  My book – “Pro ASP.NET SharePoint 2010 Solutions – Techniques for Building SharePoint Functionality into ASP.NET Applications” has been released by APress to the public.

9781430231110

Amazon.com link is here - http://www.amazon.com/ASP-NET-SharePoint-2010-Solutions-Functionality/dp/1430231114/ref=sr_1_1?ie=UTF8&s=books&qid=1295283824&sr=1-1

To document my journey with writing this book, it began with doing a few projects in MOSS 2007 where the core portion of the application was not SharePoint, but an ASP.NET application.  However, with the extensive requirements for documentation, SharePoint was chosen as a platform.   I quickly found out that there was very little content published about scenarios of this nature.   So I started cataloging my learning along the way.

Now I have a long and extensive background in ASP.NET development that actually dates back to it’s beginning.  I did some classic .asp development, and switched over to ASP.NET immediately.  Interestingly enough, my classic ASP work that I did was mostly in the VB language, but when .NET came out I switched immediately over to coding in C#.   Languages aren’t really a hindrance to me as I have cataloged over 35 programming languages I have written code in throughout my career.  I’ve actually slowed up a little recently and need to branch out!  (F# is on my horizon, as well as compiler constructs for DSL application – LALR parsing algorithms).

So what we found out on these projects was that SharePoint has quite a number of compelling features for a development platform to start from.  I highlight many of these in Chapter 1 of my book entitled “SharePoint as a Development Platform”.   The main drawback I found was there were technological and cultural barriers to entry.   The nature of SharePoint product configuration and necessity of understanding its architecture was the highest barrier to entry for a standard ASP.NET developer.   So one of my goals in writing the book was to help ASP.NET developers jump over that barrier.

In SharePoint 2010 I found that Microsoft also has put a great deal of effort into this goal as well.  I started corresponding with Reza Chitsaz who is a Sr. Program Manager with the Visual Studio team who was in charge of integrating many of those features for SharePoint development into the Visual Studio IDE.   The team did a great job of initial integration there, and I look forward to further developments!   Chapter 2 of my book deals with all of the advancements in the Visual Studio 2010 IDE, and is entitled – “Visual Studio 2010 – Enhancing the SharePoint Development Environment”. 

Throughout the rest of my book I tried to achieve a balance between a succinct education on many of the architectural constructs of SharePoint 2010 and providing good real world code samples of some of the things that I ran into with the initial blended projects.

The other main thing I introduce in the book is a way that I developed of looking at some of these projects.   SharePoint is such a huge product that customizations and integrations tend to be all over the place.  I found it helpful to try and categorize the types of approaches together into types of solutions.  In my book I coin the phrases “Low Touch Point Solutions, Medium Touch Point Solutions, and High Touch Point Solutions” as terms to help categorize approaches and levels of effort with SharePoint / .NET development.   This has proved helpful to myself and the teams I’ve worked with as well as some others I have discussed the topic with in the community.

One of the last things I wanted to mention about my book is that I endeavored to give code examples of some of the common challenges I ran into when using SharePoint 2010 as a .NET development platform.  To keep things interesting, I also included in code examples some approaches that could serve as patterns for interacting with some of the newer technologies out such as SQL Azure and the Azure Data Marketplace.   The places we look for information is rapidly changing, and these approaches are not too far off the horizon for mass implementation.

So that’s my book – it’s just out, and I hope readers will give it a chance and look it over as well as check out the code samples which are available on the APress site.

To conclude, I will list a complete Chapter / Section Table of Contents to help reader selection.

Book Content

  • Chapter 1 – SharePoint as a Development Platform
    • SharePoint Features
      • Extensibility
      • Document Management
      • Authentication and Authorization
      • Microsoft Office Integration
      • SharePoint Designer 2010
      • SharePoint Workspace
      • Visual Studio 2010 Integration
    • Common Approaches to Application Development in SharePoint
      • Intranet Scenario
      • Publishing Site Scenario
    • Sandboxed Solutions
    • Advanced Approaches to Application Development
    • Summary
  • Chapter 2 – Visual Studio 2010 – Advancing the SharePoint Development Environment
    • Anatomy of a SharePoint 2010 Project
      • Empty SharePoint Project
      • Visual Web Part
    • Wrapping ASP.NET Development
    • Coding the Sample Visual Web Part
    • Deploying a Solution
      • Examining the Deployment Process
      • Deploying to a Test or Production Environment
    • Using Features
      • Feature.Template.xml
      • Feature1.feature and Feature1 Nodes
    • Package Designer
    • Packaging Explorer
    • SharePoint Project Templates
      • Sequential Workflow
      • State Machine Workflow
      • Business Data Connectivity Model
      • Event Receiver
      • List Definition
      • Content Type
      • Module
      • Site Definitions
      • Import Reusable Workflow
      • Import SharePoint Solution Package
    • Other Visual Studio Templates and Features
    • Team Development
      • Development
      • Test
      • Production
    • Summary
  • Chapter 3 – SharePoint, IIS and the .NET Framework
    • SharePoint 2010 in IIS 7 Manager
      • IIS and .NET Fundamentals
      • SharePoint 2010 File System Folders Under IIS
      • SharePoint 2010 Virtual Directories
    • SharePoint 2010 and the .NET Framework
      • WSS web.config File
      • Code Access Security
      • Sandboxed Solutions
    • Summary
  • Chapter 4 – SharePoint Architecture – File System, Database, and the Provider Pattern
    • SharePoint 2010 and the File System
      • SharePoint Root
      • Program Files\Microsoft Office Server
      • WSS Folders
    • SharePoint 2010 Databases
    • SharePoint 2010 and the Virtual Path Provider Pattern
      • Object Oriented Architecture
      • The Provider Pattern
      • The Virtual Path Provider
    • Summary
  • Chapter 5 – Web Parts and Master Pages
    • Web Parts
      • Building a Visual Web Part
      • Building a Standard SharePoint Web Part
      • Building a Silverlight Web Part
      • Accessing External Database Content in a Web Part
      • Web Parts Summary
    • Master Pages
      • Understanding Where Master Pages Are Used
      • v4.master
      • Master Page Content
    • Summary
  • Chapter 6 – The Client Object Model
    • Introducing the Client Object Model
      • .NET Managed and Silverlight Based Clients
      • ECMAScript/JavaScript Clients
      • Taking Advantage of the Client Object Model
    • Client Object Model Components
      • .NET Components
      • Silverlight Components
    • Client Object Model API Support
    • Data Retrieval and Interaction
      • LoadQuery and Load
    • Client Object Model – The Big Three
      • Client Object Model Reading List Data via ASP.NET
      • Client Object Model Writing List Data via ASP.NET
      • Client Object Model Reading List Data via Silverlight – From a Web Part
      • Client Object Model Writing List Data via Silverlight
      • Debugging Silverlight in SharePoint 2010
      • Client Object Model Reading List Data via ECMAScript / JavaScript
    • Summary
  • Chapter 7 – Business Connectivity Services
    • What Are Business Connectivity Services?
    • BCS Solutions with SharePoint Designer
    • BCS Solutions with Visual Studio 2010
    • BCS Architecture
    • Summary
  • Chapter 8 – Touch Points – Integrating SharePoint 2010 and ASP.NET
    • Integration Factors
    • Example Business Scenarios
      • Corporate Internet and Service Portals
      • Existing ASP.NET Product
      • New Blended Solution
      • Expanding Your Corporate Portal
      • Talking to SharePoint
    • Organizational Factors
      • Organizational Examples
      • SharePoint-Centric Organizations
    • Touch Points
    • Low Touch Point
      • Pros
      • Cons
    • Branding SharePoint Solutions
      • Branding Possibilities, Features, and Tools
      • SharePoint Server 2010 Publishing Features
      • Working With a Brand
      • Branding the ASP.NET Application
      • Branding in SharePoint Designer Example
      • Deploying Branded Solutions
    • Publishing Layouts
    • Customizing SharePoint 2010 Navigation
      • Customizing Navigation Through the User Interface
      • Adding Links through the Object Model
      • Navigation Custom Data Sources
    • Summary
  • Chapter 9 – Medium Touch Point Solutions
    • Medium Touch Points
      • Pros
      • Cons
    • Medium Touch Point Examples
      • SharePoint and the Cloud
      • SharePoint 2010 and Windows Azure MarketPlace
      • PowerPivot and Azure
      • Accessing Azure DataMarket Feeds Through .NET
      • Integrating External Feeds Through .NET WCF Services and jQuery
      • Consuming an oData Feed with jQuery in SharePoint 2010
    • Summary
  • Chapter 10 – High Touch Point Solutions
    • Tenets and Constraints for High Touch Point Solutions
    • High Touch Point Blended Solution Example
    • Migrating an Existing ASP.NET Application
    • Load Testing Your Blended Solution
    • Summary and Conclusion

Thanks for checking out my book!

Dave Milner

SPTechCon 2010–Boston–My Technical Class

I am presenting a class session at SPTechCon Boston on Friday – 10/22/2010 – from 2:30 – 3:45 PM in the Molly Pitcher Rm of the Hyatt Regency Cambridge, where SPTechCon is taking place.

The class details are as follows:

808 – Architecting a Blended SharePoint 2010 / ASP.NET Solution

SharePoint is beginning to be used more widely as a development platform for a wide variety of ASP.NET applications. SharePoint architects, developers and IT professionals are being called on to design, architect, develop and provide a stable environment for a growing base of SharePoint site collections blended with an increasing amount of custom code. This session will show how to incorporate functionality that comes prepackaged in SharePoint such as wikis, blogs, lists, document management, user authentication and authorization with core ASP.NET application functionality. It will expand upon design and architecture concepts for setting up ASP.NET applications within a SharePoint farm. We will cover approaches to solution development and deployment, performance considerations for blended solutions, packaging recommendations and monitoring tools. We will go in-depth into the packaging and feature designers in Visual Studio 2010 for architecture and deployment considerations, and we will show techniques for upgrading an ASP.NET application to work within SharePoint, allowing you to leverage the power of SharePoint alongside the rapid development possibilities inherent in ASP.NET application development. Some familiarity with .NET development and SharePoint is required.

The materials for this class can be found in the following SkyDrive folder – will include PowerPoint slides and all code demos.

Dave Milner Session Materials

ShareSquared Openings

ShareSquared is looking for a few good SharePoint / .NET Developers.  If that is you please see http://www.sharesquared.com/company/Pages/Careers.aspx and send your resume to careers@sharesquared.com

If you know me and would like a personal introduction, please get in touch.

Thanks!!!

Add SharePoint PowerShell cmdlets to your default PowerShell Profile

One of the most annoying things to me in dealing with all of the great features in SharePoint 2010 and the administration of it through PowerShell is that I have to go through the menu system to get to it.

I have a perfectly functional QuickLaunch Powershell icon right next to my Windows Start icon in the bottom left corner of my Windows 2008 Server R2 install.  However, it doesn’t have the SharePoint cmdlets installed.  I also have the SharePoint cmdlets loaded into a SharePoint Powershell through Start-> All Programs –> Microsoft SharePoint 2010 Products –> Microsoft SharePoint 2010 Management Shell.  However, this is downright inconvenient.

One of the problems here is versioning.  The SharePoint Powershell cmdlets are written as a v1.0 snapin.  However, 2008 Server R2 has PowerShell 2.0 natively installed.  Also, upgrades to other OS’s specifically to PowerShell as well as other potential automatic updates are not always going to be v1.0 only.  PowerShell 2.0 brings in a number of desirable advancements, two of which being module packaging and remote execution.  For these reasons, I don’t want to live in the PowerShell 1.0 world any longer than I have to.  But I use PowerShell for SharePoint 2010 more than for anything else.

I have here a dilemma.   This dilemma is solved by customizing my PowerShell profile.  Just like in the old BSD Unix days where you “dot in your dot profile” settings, PowerShell has the ability to execute a profile settings file when you start up either a command shell or the ISE. 

Probably the easiest way to fix this dilemma is found in some code published by TomWis on MSDN blogs here:

http://blogs.msdn.com/b/tomwis/archive/2010/01/05/enable-sharepoint-powershell-commandlets-in-the-powershell-ise.aspx

With a few quick lines of code you can modify and save your profile settings to include the SharePoint Powershell snapin. 

if (!(test-path $profile )) 
{ 
    new-item -type file -path $profile -force 
} 
 
 
$cmd = 'if((Get-PSSnapin | Where-Object {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) 
{ 
    Add-PSSnapIn "Microsoft.SharePoint.Powershell" 
}'
 
out-file -FilePath $profile -InputObject $cmd -Append

You can cut and paste that code into a PowerShell started up with your little icon next to the Windows icon in QuickLaunch.  That will forever modify your profile so that the SharePoint cmdlets are loaded when you start a shell via that icon.

Well what about all the really cool scripts I write with the PowerShell ISE?  you ask.  The same goes for startup profiles for the ISE.  Cut and paste the above code into your ISE Shell (started by right-clicking the QuickLaunch icon previously mentioned and selecting the “Windows PowerShell ISE” menu option).

What this code does is saves the big if statement with the Get-PSSnapin to a .ps1 file attached to your profile.  You can see the location of this file by typing in $profile and hitting <Enter> in your PowerShell shell.  These files are stored in your Documents directory, under WindowsPowerShell, and the files are named Microsoft.PowerShell_profile and Microsoft.PowerShellISE_profile accordingly.  The if loop at the start of the code tests to see if you have a directory already set up to hold profile settings and if there is not one, it creates that directory.

So now all of the features wrapped into the “Microsoft.SharePoint.PowerShell” SnapIn including all the cmdlets for managing your SharePoint 2010 sites are right there at your fingertips.