Wednesday, November 30, 2011

Change Sql Azure DB Size

Hi All,

I was trying to change my business edition DB to web edition in SQL Azure and i didn't find a sample TSQL to run to shrink the DB file size from 20 GB (Business) to 1 GB (Web) Edition.

Here is the TSQL you want to run after deleting the unnecessary data in your DB and make sure its size under the required new DB size.



Alter database YOURDBNAME

 modify (          
           maxsize=1 GB,
           Edition='Web'
        )

Hope this helps.

Thursday, November 10, 2011

SharePoint Restore Error: Your backup is from a different version of Microsoft SharePoint Foundation and cannot be restored to a server running the current version. The backup file should be restored to a server with version '14.0.0.5050' or later

Hi Folks,

I was deploying a new release for a SharePoint project that i'm working on with my team, when i was try to backup and restore a site collection from my development to staging environment, I got this error:


SharePoint Restore Error: Your backup is from a different version of Microsoft SharePoint Foundation and cannot be restored to a server running the current version. The backup file should be restored to a server with version '14.0.0.5050' or later.


To fix this problem, follow these steps:

1) Make sure that both environments have the same updates and CUs. To do so, Open Central Administration and click on Upgrade and Migration link and click on "Check product and patch installation  status".
You will have list of updates and CUs that have been installed on your environment, make sure those updates are identical. Any missing updates, download and install it on the new environment if you haven't document this as a part of your release process that you have in place.

2) Then click on "Review database status" under upgrade and migration section and make sure you don't have "need upgrade" to any of your content databases.The status should be "No action required". If you have any upgrade required and specially if you have SP1 installed, this means you didn't run the SPConfig command post to your SP1 installation. To do so, follow these steps:

a) Launch an elevated (Run as Administrator) SharePoint 2010 Management shell :
(get-spserver $env:computername).NeedsUpgrade
If the result of this command is True, then you need to complete step (b) below. If the result is False then no further action (b) is needed.
b) In order to update the SharePoint databases, you must manually run the PSconfig utility. To run the utility:

  - Open an Administrative command prompt. 
  - Change directory to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN 
  - Run:
    PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures

Wait till the configuration wizard finishes all updates and then you will be able to backup and restore your site collection with no issues...


Hope this helps.

Wednesday, November 02, 2011

Secure Store Service Error in SharePoint 2010 : Secure Store Service is not accessible

Hi All,

I have been noticed that one of our SharePoint 2010 installation has a problem when trying to click on Secure Store Service in central administration.

The problem is : Try to click on SSS service in Central Administration and you will get an error page.

How to check the exact problem: I checked the event log in my server and i found the following error:

The Secure Store Service application Secure Store Service is not accessible. The full exception text is: The HTTP service located at https://PORTALURL/b04c52908ae5479596745e86b13875d4/SecureStoreService.svc/https is too busy.

To cause of the problem: the SSS service is not provisioned correctly, and to fix it:
Select the secure store service and from the ribbon click on properties. Verify the information that you have and click on OK. this action will provision the required DB and other service application configuration for this service.

This action will take around 5 minutes or depends on the performance of your server.

You don't need to re-install or run the configuration wizard for this fix.

Hope this helps :) Happy SharePointing...


User Profile Synchronization in SharePoint 2010 Facts

Hi Folks,

I'd like to share with you some important facts about User Profile synchronization in SharePoint 2010. SharePoint 2010 has User Profile Service application which provides a two-way synchronization for users/groups from your directory services or any external system in sync with SharePoint 2010 users and groups profiles.

Terms used in this post:
* UP: User Profile.
* UPSSA: User Profile Synchronization Service Application.
* UPSS: User Profile Synchronization Service.

Here are some facts you should be aware when you start planning for user profiles in SharePoint:
1) SharePoint 2010 has User Profile Service Application which manage the synchronization process between SP and AD or any external system that contains users & groups.

2) SP 2010 provisions a version of Microsoft Forefront Identity Manager to participate in synchronization.

3) UPSSA can only have one user profile synchronization service.

4) A UPSS is associated with connections and mappings.

5) We divide connections in UPSS into two types: connections to directory services, and connections to business systems.

6) When you setup a connection in UPSS to connect to directory services, You specify which containers to be included in the synchronization. You can specify filters to exclude service or disabled accounts.

7) Mapping is a step to map SharePoint user profile fields to directory services/external system user profile master data fields.

8) Upon each synchronization, SharePoint deletes SP users who have been deleted from Directory services.

9) Upon each synchronization, SharePoint add and updates SP user profile's fields as configured in the UPSS.

10) IMPORTANT: If you have multiple directory services, each directory services MUST provide unique users. You can't synchronize a single user with multiple directory services.

11) IMPORTANT: You can populate properties from any existing business system. You can't create new user profiles from an external system, and you can't write data back to a business system.

12) To synchronize properties from external system, First you should create an external content type to bring data from the business system into SP 2010. Then you will be able to synchronize these users into SP.

13) You should have a key field to be used for mapping between SP user profiles and your external system. You can use employee's work email as the identifier of your external content type. In this case, SP will synchronize information which matches employee's email to be captured in your synchronization records.

14) You can build a custom solution using SP object model to create user profiles in SharePoint.

Hope this helps.


References:
1) Profile Synchronization overview in SP 2010:
http://technet.microsoft.com/en-us/library/gg188041.aspx
2) BCS Overview in SP 2010:
http://technet.microsoft.com/en-us/library/ee661740.aspx



Unable to use SQL Server because ASP.NET version 2.0 Session State is not installed on the SQL server. Please install ASP.NET Session State SQL Server version 2.0 or above.

Hi Folks,

I was deploying an asp.net website which configured to store session data in a custom databases in SQL Server 2008. After i scripted the whole DB and moved it to a new server and after deploying the website and try to run the application, I was getting this error:


Unable to use SQL Server because ASP.NET version 2.0 Session State is not installed on the SQL server. Please install ASP.NET Session State SQL Server version 2.0 or above.


My web.config configurations:

 <system.web>
 
      
      <sessionState
       mode="SQLServer"
       cookieless="false"
       timeout="20"
       sqlConnectionString="data source=SERVERNAME; initial catalog=MYDB; user id=mostafa; password=mostafaelzoghbi" 
       allowCustomSqlDatabase="true"
      />
      
       system.web> 


Since this error message is misleading, you don't need to run aspnet_regsql command since i was using a custom database and all stored procedures, tables, custom user data types and DB objects have been scripted and deployed too. the cause of this error if you didn't give enough permission to the user that accesses the database. User should have execute permissions or grant dbo.owner to it.

Hope this helps.