Thursday, 31 May 2012

Failed to load expression host assembly. Details: Could not load file or assembly 'Microsoft.EnterpriseManagement.Reporting.Code, or one of its dependencies. Failed to grant minimum permission requests.(rsErrorLoadingExprHostAssembly)

Got this error in SSRS reports containg SCSM 2012 reports performed the following steps and it resolved the issue for me.

Logon to the SSRS server

1)       Copy the Microsoft.EnterpriseManagement.Reporting.Code.dll file from the prerequisite folder of SCSM 2012 Installation media and place it in a folder
2)      Drag and Drop Microsoft.EnterpriseManagement.Reporting.Code.dll  here

C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\Bin.

3)        Add a code segment to the Rssrvpolicy.config file
4)      Navigate to C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer.
5)      Open the Rssrvpolicy.config file.
6)      Scroll through the Rssrvpolicy.config file and locate the CodeGroup code segments. The following code shows an example of a CodeGroup segment.
   class="UnionCodeGroup"
   version="1"
   PermissionSetName="FullTrust">
   <IMembershipCondition
      class="UrlMembershipCondition"
      version="1"
      Url="$CodeGen$/*"
   />
</CodeGroup>

7)      Add the following CodeGroup segment to the same section as the other CodeGroup segments in the Rssrvpolicy.config file.
<CodeGroup
   class="UnionCodeGroup"
   version="1"
   PermissionSetName="FullTrust"
   Name="Microsoft System Center Service Manager Reporting Code Assembly"
   Description="Grants the SCSM Reporting Code assembly full trust permission.">
   <IMembershipCondition
      class="StrongNameMembershipCondition"  
      version="1"
      PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9"
/>
</CodeGroup>
8)      Close and save the changes.
9)      Stop and Start SSRS Service


Monday, 28 May 2012

Integration of SCSM 2012 and SharePoint 2010

Integration of SCSM 2012 and SharePoint 2010

There is an installer that you have to run in order to provision the service portal on the SharePoint Server box, but somehow that didn’t work for us and had to rely on traditional SharePoint solution deployment approach.

While using service portal installer gave an error _Cannotcreatesite or _Cannotdeploysolution If I remember correctly and had to use this approach.

First of all make sure you create either self-signed or domain certificates on SCSM and SharePoint servers. This is an important phase to understand whether to use self-signed or domain certificates if you have a CA server which provisions certificates in your organization.

Here are the steps we followed:

Login to SharePoint Server
Create a dedicated web application and with its own content database
DNS host header entry for resolving the name
Change the alternate access mapping, add https , http url’s
Make sure you have https on port 443 on both Web Content Server and SharePoint Server for SCSM Portal
Go to IIS Manager, add the binding for https and select the certificate for the same

In IIS Manager, select the SCSM website and from the right pane click on Application Settings

Right Click and click on Add


In the Name , type: SMPortal_WebContentServer_URL
In the URL, enter the https URL of web content server i.e. https://webcontserver.contoso.com/contenthost/clientbin
Click Ok

Now that we have a web application for SCSM and the content server set. It’s time to deploy the Microsoft.EnterpriseManagement.ServiceManager.Portal.SharePointSite.wsp onto SharePoint server.

Logon to the SharePoint Server
Launch SharePoint 2010 Management Shell
Copy the WSP from Development environment ( C:\inetpub\wwwroot\wss\VirtualDirectories\portnumber of scsm web app\ you will find the wsp here)  to the C Drive and place in a folder called from Package

Run this command

Add-SPSolution -LiteralPath c:\package\ Microsoft.EnterpriseManagement.ServiceManager.Portal.SharePointSite.wsp

Install-SPSolution –Identity Microsoft.EnterpriseManagement.ServiceManager.Portal.SharePointSite.wsp  –WebApplication http://SCSMportal.contoso.com  –GACDeployment

When the package is deployed.
Navigate to the SCSMportal on https
Go to the Site Collection Features
Activate SMPortal SharePointSite Feature
This will also activate Web Template feature of exported web template SMPortal

This may take  up to 5 minutes to activate the feature and provision the SM Portal

Access the site on https i.e. https://scsmportal.contoso.com/smportal

If you see a blank page may be you may not set the correct URL for web content server or the web content server doesn’t connect with your SharePoint environment.

In the first case, make sure you enter the correct URL i.e. FQDN

This should display some xml content if it doesn’t you may have to check if static compontent was installed with IIS. This has more to do with IIS. 

It was seamless process when we tried on Development environment but on Production took a toll on us and it was quite a journey, eventually we got there.

Most of this can be done vai powershell a single script for web app creation , solution deployment  

Monday, 21 May 2012

How to move a RBS enabled site collection to a regular (non-RBS enabled) Content Database?

Some times when you implement RBS to check out whether this will be a good fit and meets business requirement but at a later stage you may feel this doesn’t fit the purpose. You think about shifting a RBS enabled site collection to non RBS enabled site collection and RBS is tricky but easy to set up.

RBS has its own set of pros and cons mostly performance being an issue is a key one as for my understanding.

Here is how you can do it.

1)      First take the backup of the site collection which is RBS enabled.

Backup-SPSite http:/intranet.contoso.com/sites/IT -Path C:\Backup\IT_RBS.bak

Result: This will be create a bak file which will include all the files from the local location (c or d drive set for RBS) and site structure etc.

2)     Then delete the site collection
3)     Create a new site collection with the same URL using a blank template and to have its own content database use the steps listed here:


4)     Now restore the site collection

Restore-SPSite http:/intranet.contoso.com/sites/IT -Path C:\Backup\IT_RBS.bak

Job done.

Create a site collection in a dedicated content database

This script is one of my favourite ones and handy especially when you want to create a site collection and have a dedicated database for this. For various reasons you may want to have a site collection and its own content database, it could for disaster recovery or  performance or managing databases or anything which meets your requirement. If you intend to  use this test in your Test/Dev environment.
Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue
$server = Read-Host “Enter SQL Server”
$dbname = Read-Host “Enter Database Name”
$webapp = Read-Host “Enter Web Application URL”
$site = Read-Host “Enter New Site Collection URL”
$owner1 = Read-Host “Enter Primary Site Collection Admin”
$owner2 = Read-Host “Enter Secondary Site Collection Admin”
New-SPContentDatabase -Name $dbname -DatabaseServer $server -WebApplication $webapp | out-null
New-SPSite -URL $site -OwnerAlias $owner1 -SecondaryOwnerAlias $owner2 -ContentDatabase $dbname | out-null
Get-SPContentDatabase -Site $site | Set-SPContentDatabase -MaxSiteCount 1 -WarningSiteCount 0
Write-Host ” “
Write-Host “Site Collection at” $site “has been created in the” $dbname “content database” -ForegroundColor Yellow
Copy the commands and save this with an extension .PS1 and run it

Thursday, 3 May 2012

Database is in compatibility range and upgrade is recommended

Recently created a development box for our developers and as a part of this had to copy the production data into it. Followed the content database migration approach worked well but this error popped in later.

Database is in compatibility range and upgrade is recommended. The following databases have versions that are older than the current SharePoint software, but are within the backwards compatible range.

WSS_Content_First
WSS_Content_Second

$contentdb = Get-SPContentDatabase | Where-Object {$_.Name -match  "WSS_Content_First"}

Upgrade-SPContentDatabase -Identity $contentdb

This worked for one of the content database but for the second one it failed.  Had a look at the log files and there was some class id missing. All solutions were deployed was bemused. Used my lethal weapon PSconfig but this one failed:

PSConfig.exe -cmd upgrade -inplace b2b -wait

Had no choice to unleash the force beast, ran this:

PSConfig.exe -cmd upgrade -inplace b2b -force

This one worked all well and now don’t see any more upgrade required message. Happy days.