Thursday, January 31, 2013

Enable NetFx3 on Windows Server 2012

If you are planning to install SQL Server 2012 on Windows Server 2012, NetFx3 is a pre-requisite.
In order to intall NetFx3 what you need is to Mount installation ISO of Windows Server 2012 and run this command at prompt:

dism /online /enable-feature /all /featurename:NetFx3 /source:f:\sources\sxs

where f: is the letter of mounted ISO.

Setup will complete sucessfully and you can install SQL Server 2012.

Friday, January 25, 2013

Reporting Services SharePoint Integrated - Permission Consideration

On MSDN there's a very usefull article about permission mapping between SharePoint and Reporting Services in Integrated Mode.

One things to consider is that if you wanna create a Subscription over a Report in a Report Library what you need is at least this flag in the permission level binded to the user (or SharePoint Group).

At Site Level you need: Manage Alerts
At List  Level you need: Create Alerts (+ obviously Read access)

The article is readable here:

Site and List Permission Reference for Report Server Items

SQL Function to Strip HTML String

I've found this simple SQL script that create a SQL Function that receive an HTML varchar(max) string in input and return a linear flat Text String (varchar(max)) without HTML markup.
This can be usefull if you plan to store HTML in SQL column and you need to return a plain text.

CREATE FUNCTION [dbo].[StripHTML]
 (@HTMLText VARCHAR(MAX))
 RETURNS VARCHAR(MAX)
 AS
 BEGIN
 DECLARE @Start INT
 DECLARE @End INT
 DECLARE @Length INT
 SET @Start = CHARINDEX('<',@HTMLText)
 SET @End = CHARINDEX('>',@HTMLText,CHARINDEX('<',@HTMLText))
 SET @Length = (@End - @Start) + 1
 WHILE @Start > 0
 AND @End > 0
 AND @Length > 0
 BEGIN
  SET @HTMLText = STUFF(@HTMLText,@Start,@Length,'')
  SET @Start = CHARINDEX('<',@HTMLText)
  SET @End = CHARINDEX('>',@HTMLText,CHARINDEX('<',@HTMLText))
  SET @Length = (@End - @Start) + 1
 END
 RETURN LTRIM(RTRIM(@HTMLText))
 END

This just for my note and reminder.

Excecute rdlc Reports server side

In order to be able to render a rdlc report at server Runtime you need to install this Redistribuible package.

There are different version:

Microsoft Report Viewer 2012 Runtime – BETA
Microsoft Report Viewer 2010 Redistributable Package
Microsoft Report Viewer Redistributable 2008

For more about rendering rdlc reports you can check this usefull article.

Render a .rdlc reports in Excel format.

SQL Function to Split a varchar Field

I've found on the web but I cannot remember where, a very usefull SQL Function used to strip an input string. Return parameter is a table.

CREATE FUNCTION [dbo].[Split] (@s varchar(512), @sep char(1))
RETURNS table
AS
RETURN (
    WITH Pieces(pn, start, stop) AS (
      SELECT 1, 1, CHARINDEX(@sep, @s)
      UNION ALL
      SELECT pn + 1, stop + 1, CHARINDEX(@sep, @s, stop + 1)
      FROM Pieces
      WHERE stop > 0
    )
    SELECT pn,
      SUBSTRING(@s, start, CASE WHEN stop > 0 THEN stop-start ELSE 512 END) AS s
    FROM Pieces
  )

The limit of this function is that you cannot use OPTION (MAXRECURSION nnn) to change default 100 limit in SQL recusrsion.

Wednesday, January 23, 2013

SharePoint 2010 - Browser File Handling Bug

There is a flag web application level that allows you to manage how SharePoint 2010 handles opening of documents other than Office.

You can force the download on the client (strict mode - this is the default) rather than directly open the document (permissive).

The setting works as described except that in a case:

- The document library is created from a site template (wsp solution).

In this case, all Document Library in the instanziated site have the property "BrowserFileHandling" set to Strict, ignoring the settings of the webapplication.

With this simple powershell script to run through the SharePoint Management Shell, you can reset all the document library of all the web for a specific site collection to the desired behavior.



$site=Get-SPSite http://sitecollectionurl
$webs=$site.AllWebs


foreach($web in $webs)
{
 $web

 foreach($list in $web.Lists)
 {
  $list.BrowserFileHandling = "Permissive"
  $list.Update()
 }
}
 
 

Forefront Identity Manager - Schema validation failed

This post want to share my experience about "Schema Validation Failed" error logged every minute on the Application Log, associated to FIM Service of SharePoint 2010.

The error detail is:

Log Name:      Application
Source:        Forefront Identity Manager
Date:          23/01/2013 15:42:01
Event ID:      3
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      xxxxxxx.xxx.xxx
Description:
System.Data.ConstraintException: Schema validation failed.
Event Xml:
<Event xmlns="
http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Forefront Identity Manager" />
    <EventID Qualifiers="0">3</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2013-01-23T14:42:01.000000000Z" />
    <EventRecordID>556000</EventRecordID>
    <Channel>Application</Channel>
    <Computer>xxxxxxx.xxx.xxx</Computer>
    <Security />
  </System>
  <EventData>


Immediatly after this error, another more detailed is logged on the App log.
The second error detail is:

Log Name:      Application
Source:        Forefront Identity Manager
Date:          23/01/2013 15:42:01
Event ID:      3
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      xxxxxxx.xxx.xxx
Description:
Microsoft.ResourceManagement: System.Data.ConstraintException: Schema validation failed.
   at Microsoft.ResourceManagement.Utilities.ExceptionManager.ThrowException(Exception exception)
   at Microsoft.ResourceManagement.ActionProcessor.ActionDispatcher.ProcessInputRequest(RequestType request)
   at Microsoft.ResourceManagement.WebServices.RequestDispatcher.ExecuteAction(RequestType request)
   at Microsoft.ResourceManagement.WebServices.RequestDispatcher.ExecuteAction[ResponseBodyType](RequestType request)
   at Microsoft.ResourceManagement.WebServices.RequestDispatcher.DispatchRequest[ResponseBodyType](RequestType request, Guid requestIdentifier, Object redispatchSingleInstanceKey)
   at Microsoft.ResourceManagement.WebServices.RequestDispatcher.DispatchRequest[ResponseBodyType](RequestType request)
   at Microsoft.ResourceManagement.WebServices.ResourceManagementService.Create(Message request)
Event Xml:
<Event xmlns="
http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Forefront Identity Manager" />
    <EventID Qualifiers="0">3</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2013-01-23T14:42:01.000000000Z" />
    <EventRecordID>556001</EventRecordID>
    <Channel>Application</Channel>
    <Computer>xxxxxxx.xxx.xxx</Computer>
    <Security />
  </System>
  <EventData>
    <Data>Microsoft.ResourceManagement: System.Data.ConstraintException: Schema validation failed.
   at Microsoft.ResourceManagement.Utilities.ExceptionManager.ThrowException(Exception exception)
   at Microsoft.ResourceManagement.ActionProcessor.ActionDispatcher.ProcessInputRequest(RequestType request)
   at Microsoft.ResourceManagement.WebServices.RequestDispatcher.ExecuteAction(RequestType request)
   at Microsoft.ResourceManagement.WebServices.RequestDispatcher.ExecuteAction[ResponseBodyType](RequestType request)
   at Microsoft.ResourceManagement.WebServices.RequestDispatcher.DispatchRequest[ResponseBodyType](RequestType request, Guid requestIdentifier, Object redispatchSingleInstanceKey)
   at Microsoft.ResourceManagement.WebServices.RequestDispatcher.DispatchRequest[ResponseBodyType](RequestType request)
   at Microsoft.ResourceManagement.WebServices.ResourceManagementService.Create(Message request)</Data>
  </EventData>
</Event>
    <Data>System.Data.ConstraintException: Schema validation failed.</Data>
  </EventData>
</Event>


After a lot of research, verbose logging, and the use of this usefull utility founded on Codeplex (FIMQueryTool - thanks a lot to the author), I was able to have more datail about the Failing Request.

The problem was related to a recently change of the permission of my SharePoint User Profile Service Application.

Basically I've garanted "Edit Profile permission" to a specific Active Directory Security Group.

This AD Security Group contains a blank in "PreWindows 2000 Name".

This blank was causing FIM Service to fail in validating Schema during the process of the Request related to this AD Group.

Removing the blank will fix everything.

I don't know if this can be considered a Bug or not. We can see if further SharePoint 2010 Cumulative Update or Service Pack will fix it.

This behavior has been discovered using SP1 + June 2012 Cumulative Update (kb2687299).

Monday, January 21, 2013

From SharePoint 2010 to 2013 - Changes

During evaluation impact of migration from a SharePoint 2010 Farm to a SharePoint 2013 farm you need to consider what's changed between the two version of the Platform.

TechNet has a good article that explain all the differences, the reason for changes and the eventually migration path (if apply):

Changes from SharePoint 2010 to SharePoint 2013

One important things to consider is that ther's no plan to continue support Document Workspace and Meeting Workspace. Infact, migrated site will continue to work due to the presence of web template, but furter creation based on these templates are not supported. These templates will be removed completely from the next major release of SharePoint.

The feature of creating Meeting Workspace from Outlook 2013 has been removed.

Friday, January 18, 2013

How To Create a Slide Library in SharePoint 2013

In SharePoint 2013 there is no Slide Library listed when you choose to add an App.
This feature is still present.

To create a Slide Library in SharePoint 2013 you need to navigate to

http://yourwebappname/yoursitename/_layouts/15/slnew.aspx?FeatureId={0be49fe9-9bc9-409d-abf9-702753bd878d}&ListTemplate=2100

I've tested it on a RTM version of SharePoint 2013 and it works.

This library seems to be the same we had on SharePoint 2010. Also FeatureId is the same as in SharePoint 2010.