SharePoint24x7 It's all about SharePoint.

3Jul/150

Tips n Tricks – Reducing the SharePoint Config Log file size

Posted by Joy

Today we came across with a situation where we keep getting a runtime error when we try to perform our normal day-today operations in our SharePoint 2013 based solution. It started throwing a runtime error with a error code - HRESULT: 0x80131904 and it failed to save data into the SharePoint database.

The reason was the SharePoint Configuration database LOG file has grown to 91 GB and there was not enough free space in the physical disk. Because of this, SharePoint was unable to commit database changes and there was a huge performance impact. The solution we found was:

  1. Change the recovery model for the Database from Full to Simple
  2. Shrink the database

I executed the following SQL command and it brought the database log file from 91GB to 1 MB which solved my issues.

USE [master]
Go

ALTER DATABASE[SharePoint_Config] SET RECOVERY SIMPLE WITH NO_WAIT
Go

USE [SharePoint_Config]
Go

DBCC SHRINKFILE ('SharePoint_Config_Log')
Go

12Dec/130

Article – Host-named Site Collections

Posted by Joy

Host header or Host-named?

I know for most of us, at the beginning, these 02 terms, what they are and difference between these 02 are very confusing. I'm writing this to help you understand it very easily.

Prior to SharePoint 2013

With the early releases of SharePoint, when we wanted to create a new Site Collection, we had 2 options to define their URLs:

  1. Rely on physical server name and port combination
  2. Rely on host header paths

Physical server name and port combination

This was the case we used to rely on almost all the developer environments. We ended up having web application URLs attached to the physical server name and port combination, similar to:

Site Collections we created using this approach ended up having URLs similar to:

Host header path

As an alternate, this approach helps us to address some of the issues we faced in the previous approach. With this approach we will create a Web Application by assigning a user-friendly host header such as http://contoso.com. We depend on either local hosts file (in case of development environments) or DNS (in case of staging and production environments) for mapping host header to the server IP and port. With this approach, we can have URLs similar to:

With this approach, we will be able to overcome the main issues we faced with the physical server name and port combination URLs approach. However, what if we want to create site collections with following URLs:

With any of the above 02 approaches, to implement URLs like shown above, we need to create multiple web applications each pointing to above host headers as their starting URL. Because, host headers are assigned for Web Applications and we cannot assign multiple host headers for the same Web Application. Having to creating multiple Web Applications to implement above URLs schema is not going to be a practical solution since:

  • There is a limitation of no of Web Applications which can be hosted in farm
  • Creating lot of Web Applications will introduce additional processing overhead to the farm

With SharePoint 2013

With SharePoint 2013, we can solve the above problem with an approach called Host-named Site Collections. With Host-named Site Collections approach, we can create Site Collections with user-friendly URLs with different domain names within the same Web Application. With Host-named Site Collections approach we can create following Site Collections within the same Web Application:

Now we can have just 01 Web Application, with multiple user-friendly URLs, with different domain names in them as the starting point for Site Collection URLs.

Note: though, it's a very useful approach, creating Host-names Site Collections is little tricky since it can be created only by using Windows PowerShell and cannot be created using SharePoint Central Administration web site.

12Feb/131

Article – What’s New for SharePoint Development in Visual Studio 2012 – Part I

Posted by Joy

Microsoft released Visual Studio 2012 back in September 2012. Visual Studio 2012 comes with number of new features and number of enhancements for Windows, Web, SharePoint, Mobile and Cloud development areas.

Microsoft released SharePoint 2013 also back in November 2012. Microsoft announced that Visual Studio 2012 is the official IDE for developing applications for SharePoint 2013. Not only that, Visual Studio 2012 supports developing application for SharePoint 2010 as well. What a wonderful release..?

With this and number of upcoming posts, I’m going to showcase some of the cool features available in Visual Studio 2012 for SharePoint developers.

As the start, following are the list of new and enhanced features available in Visual Studio 2012 for SharePoint development:

  • Streamlined SharePoint Project Templates
  • Create Lists and Content Types by Using New Designers
  • Create Site Columns
  • Create Silverlight Web Parts
  • Publish SharePoint Solutions to Remote SharePoint Servers
  • Test SharePoint Performance by Using Profiling Tools
  • Create Sandboxed Visual Web Parts
  • Better IntelliSense support in Sandboxed solutions
  • Better support for JavaScript Debugging and IntelliSense for JavaScript
  • Test Your Code by Using Microsoft Fakes Framework
  • Apps development support for Office and SharePoint 

I will be writing number of future posts to discuss some of these useful features in details. Please have faith.

7Jan/130

Article – Custom Windows PowerShell Scripts and Local Execution Policy

Posted by Joy

Windows PowerShell supports authoring PowerShell scripts and executing them. You can write Windows PowerShell scripts using any text editor and save them with “.ps1” file extension. You may have encountered the following error when you were trying to execute your PowerShell script and this post explains the story behind this error and how to eliminate it.

I have written a very simple PowerShell script which displays “Hello, World..!” and saved into a script file names “Hello.ps1”.

write-host "====================================="
write-host "Hello, World..!"
write-host "====================================="

When I try to execute the script file using Windows PowerShell command line, I get the following error:

PSError

The reason for this is, once Windows PowerShell is configured in your server, it configures the local execution policy of your server to restricted mode to avoid any attackers to come across the network and execute any PowerShell scripts and harm your environment. Which means, no scripts can be executed without signing your scripts with a Public-Private Key pair.

You can retrieve the current mode of the local execution policy by executing following command:

PS C:\> Get-ExecutionPolicy

localexecutionpolicystatus

Following are the different modes of the local execution policy:

  • Restricted – scripts will not execute under this execution policy without signing with a Public-Private Key pair
  • Unrestricted – scripts can execute under this execution policy. However, the scripts which are not signed will continue to prompt for username and password.
  • Bypass – scripts can execute under this execution policy and it will suppress prompting for username and password

Set the execution policy to unrestricted or bypass by using following command:

PS C:\> Set-ExecutionPolicy unrestricted

Now you can run your script files and they will continue to run without complaining.

Important thing to know when we are working with SharePoint is that, installing SharePoint will loosen the execution policy to unrestricted in all the Application servers and Web Front End servers.

6Apr/120

Article – SharePoint and Search Product Acronyms. Are you also confused?

Posted by Joy

We had a good session on Microsoft FAST Search Server 2010 for SharePoint (FS4SP) few day ago and the idea was to introduce Enterprise Search concepts within our SharePoint CEG. During the session, the guy who presented touched few products related to SharePoint and Search and I noticed some of the attendees were confused with all these product names and their acronyms.

Yes, there are lot of choices from Microsoft now when we want to implement Enterprise Search or Search driven applications with or without SharePoint. Unfortunately, most of these product names are very long and we don't have any other choice rather than using their acronyms.

Based on my readings, studies and investigation, following is a list I came up with for a list of products and their acronyms related to SharePoint and Search:

Acronym Full Product Name
SPF Microsoft SharePoint Foundation 2010
SP Microsoft SharePoint Server 2010
SP-FIS Microsoft SharePoint Server 2010 for Internet Sites – Standard
SP-FIS-E Microsoft SharePoint Server 2010 for Internet Sites – Enterprise
 
Acronym Full Product Name
MSS Microsoft Search Server 2010
MSS-X Microsoft Search Server 2010 Express
FS4SP Microsoft FAST Search Server 2010 for SharePoint
FS4SP-IS Microsoft FAST Search Server 2010 for SharePoint Internet Sites
FSIS Microsoft FAST Search Server 2010 for Internet Sites
FSIA Microsoft FAST Search Server 2010 for Internal Applications
 
Hope this helps you..?
28Dec/110

Enabling Developer Dashboard in SharePoint 2010

Posted by Joy

ASP.NET provides Call Stack and Tracing as wonderful features which helps developers on investigating what is going on page rendering behind the scene. SharePoint being a product which provides bunch of features OOTB which we can use to setup a portal very easily, it hides most of these information.

Back in MOSS 2007, we had to scratch our head thinking where to start our investigation when we get an error in the browser, because that error was not descriptive enough for us to start the investigation.

In SharePoint 2010, we have a nice feature – Developer Dashboard which helps developers to be comfortable when they see an error in the browser.

Enabling Developer Dashboard

Developer Dashboard is a feature targeted for developers (administrators as well) and hence it is disabled by default. We need to enable it using one of the method mentioned below:

  • STSADM
  • PowerShell
  • SharePoint Object Model
STSADM

We still can use STSADM with SharePoint 2010 for administering SharePoint. However, STSADM is more likely to disappear in the next release. Though we can use following STSADM command to enable Developer Dashboard, I strongly recommend to get familiar with PowerShell, if you are not already.

  1. Go to the command prompt and make sure to either set the path to the location of STSADM.EXE or navigate to the bin directory in SharePoint root in your command prompt.
  2. Issue the following command in the command prompt:STSADM -o setproperty -pn developer-dashboard -pv ondemand

The above command will enable the Developer Dashboard in On Demand mode.

PowerShell
  1. Go to Start –> All Programs –> Microsoft SharePoint 2010 Products –> SharePoint 2010 Management Shell
  2. Issue the following command in the management shell:$devdash = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;
    $devdash.DisplayLevel = ‘OnDemand’;
    $devdash.TraceEnabled = $true;
    $devdash.Update()

The above command will enable the Developer Dashboard in On Demand mode.

SharePoint Object Model
  1. Create a Console Application, Windows Application or Web Site and add a reference to the Microsoft.SharePoint.dll assembly.
  2. Add using Microsoft.SharePoint.Administration namespace reference at the top of the code (C#) file.
  3. Add the following code into your code (C#) file to enable Developer Dashboard:SPWebService svc = SPContext.Current.Site.WebApplication.WebService;
    svc.DeveloperDashboardSettings.DisplayLevel = SPDeveloperDashboardLevel.OnDemand;
    svc.DeveloperDashboardSettings.Update();

The above command will enable the Developer Dashboard in On Demand mode.

I have used On Demand as the setting for Display Level of the Developer Dashboard and following are the other options we can specify:

  1. On – Enable the Developer Dashboard all the times
  2. Off – Disable the Developer Dashboard
  3. OnDemand – Enable the Developer Dashboard but will be displayed on demand.

When you enable Developer Dashboard in On Demand mode, following icon will be displayed next to your login name.

Capture1

On click of the Developer Dashboard icon, page will be reloaded and Developer Dashboard will be displayed at the bottom of the page as shown below:

Capture2

If you have also used TraceEnabled = $true switch with PowerShell, then you will see a link says “Show or hide additional tracing information …” at the end of the Developer Dashboard which allows you to show/ hide ASP.NET Tracing information as shown below:

Capture3

Isn’t this a awesome feature for you to get started your investigation exercise? Have a closer look at what Developer Dashboard offers you and it will help you in numbers of ways.

3Nov/113

Fix it – Configuring Object Cache service

Posted by Joy

If you are using Web Content Management (WCM) solutions implemented with SharePoint 2010 Publishing Infrastructure features, you will notice following Critical error in your server Event Log.

Capture9

What does it mean and how do you fix this?

This error is generated by SharePoint’s Object Cache service. In order to get rid of this error, you will have to configure Object Cache service.

What is Object Cache service?

Object Cache is a very powerful built-in service in SharePoint 2010 Publishing Infrastructure which instructs every Web Front End (WFE) to cache object properties in order to boost the performance. This reduces the load on SQL Server tremendously by reducing number of round trips required to retrieve same data from the content databases. In scenarios where you have Web Content Management solutions which go through less content changes, by configuring Object Cache, you can reduce the latency and increase the throughput.

Configuring Object Cache is all about configuring User Policies for each and every Web Applications. Object Cache is configured at the Web Application level and you need to have 02 AD user accounts for configuring Portal Super User and Portal Super Reader. Portal Super User account has full control and Portal Super Reader account has full read-only access.

Let us begin the configuration.

Task 1 – Create required AD accounts

You need to create 02 service accounts in order to configure Portal Super User and Portal Super Reader. Go to Active Directory and create 02 service accounts.

I already have 02 service accounts created named, SP_ObjectCacheUser and SP_ObjectCacheReader.

Capture1

Task 2 – Configure Object Cache User Accounts using CA

Initial configuration done using CA.

  1. Fire up the SharePoint 2010 Central Administration site by navigating to Start –> All Programs –> Microsoft SharePoint 2010 Products –> SharePoint 2010 Central Administration.
  2. Select Manage web applications link from the Application Management group.
  3. Select the web application you are planning to configure Object Cache. In my environment, for this demo, I’m selecting SharePoint – 80 web application.
  4. Click the User Policy from the Policy group in the ribbon.
    Capture2
  5. Click Add Users link in the Policy for Web Application dialog box.
    Capture3
  6. Select (All Zones) for the Select the Zone field in the Add Users dialog box and click Next > button.
    Capture4
  7. Enter the Portal Super User account for the Choose Users field and select Full Control from the Choose Permissions section and click Finish. In my demo, I have configured SP_ObjectCacheUser as the Portal Super User.
    Capture5
  8. Click Add Users link again in the Policy for Web Application dialog box.
  9. Select (All Zones) for the Select the Zone field in the Add Users dialog box and click Next > button.
  10. Enter the Portal Super Reader account for the Choose Users field and select Full Read from the Choose Permissions section and click Finish. In my demo, I have configured SP_ObjectCacheReader as the Portal Super Read.
    Capture6
  11. Policy for Web Application dialog box now will look following.
    Capture7

Task 3 – Committing configuration changes using PowerShell

Final step is to commit configuration changes using PowerShell.

  1. Fire up SharePoint 2010 Management Shell by navigating to Start –> All Programs –> Microsoft SharePoint 2010 Products –> SharePoint 2010 Management Shell.
  2. Enter the following PowerShell commands to update the settings. Change the Web Application name placeholder depending on the name of the Web Application.$wa = Get-SPWebApplication – Identity “SharePoint – 80
    $wa.Properties[“portalsuperuseraccount”] = “CONTOSO\SP_ObjectCacheUser
    $wa.Properties[“portalsuperreaderaccount”] = “CONTOSO\SP_ObjectCacheReader
    $wa.Update()

    Capture8

Now you will not see the earlier Critical error in your server Event Log as well as you will experience a reduced latency and an improved throughput.

10Oct/112

Article – Configuring Forms-based Authentication in SharePoint 2010

Posted by Joy

Configuring Form-based authentication has been always challenging in SharePoint products and technologies since its early releases. With the introduction of SharePoint 2010, it became simpler but little confusing to most of developers & administrators. I’m going to quickly go through how to configure forms-based authentication in SharePoint 2010 using a SQL Server based user store.

Note: Authentication in SharePoint can be configured only at the Web Application level. Web Application is the boundary for configuring authentication in SharePoint. Even before creating a new web application using CA, you need to decide what type of authentication you are planning to use within the web application. Changing authentication mode later might be difficult and error prone than expected.

Note: To configure form-based authentication, new claims-based authentication mode needs to be configured for the web application. In SharePoint 2010 form-based authentication is implemented using claims-based authentication and using classic mode authenticating to implement form-based authentication is not supported by Microsoft.

Configuring form-based authentication has several phases:

  1. Provisioning and configuring a custom user store
  2. Populating the user store with users and roles
  3. Creating a new Web Application
  4. Configuring STS, CA & FBA Web Application
  5. Test to see whether FBA works

Phase 1: Provisioning and configuring a user store

Task 1: Provisioning and configuring a custom user store

I’m going to use very simple script provided by Microsoft Visual Studio SDK to create a very simple user store to store all the users and roles information.

  1. Fire up Visual Studio Command Prompt (2010) by navigating to Start -> All Programs -> Microsoft Visual Studio 2010 -> Visual Studio Tools -> Visual Studio Command Prompt (2010).
  2. Enter aspnet_regsql and wait until it starts ASP.NET SQL Server Setup Wizard.
    Capture1
  3. Click Next in the Welcome to the ASP.NET SQL Server Setup Wizard page.
  4. Select Configure SQL Server for application services option from the Select a Setup Option page.
    Capture2
  5. In the Select the Server and Database page, enter name of the SQL Server for the Server: field. Select the appropriate authentication mode for the database server (In my case Windows authentication). And if you want to specify a database name, replace <default> with the name of your choice for the Database: field. Leaving Database: field with <default> will always create a database named aspnetdb. Click Next after you enter all the details.
    Capture3
  6. Click Next in the Confirm Your Settings page to start the configuration.
  7. After few seconds, you will get the “The database has been created or modified.” page. Click Finish to quit the wizard.
  8. Exit the Visual Studio Command Prompt (2010).

Task 2: Verify the existence of custom user store

  1. Fire up Microsoft SQL Server Management Studio by navigating to Start -> All Programs -> Microsoft SQL Server 2008 R2 -> SQL Server Management Studio.
  2. Connect to the correct SQL Server using Connect to Server dialog box.
  3. Expand Databases folder and verify the existence of the database aspnetdb.
    Capture4

Task 3: Configuring database access to CA and AppPool user accounts

In order to CA and Web Applications to being able to communicate with the custom user store (aspnetdb database), we need to grant access to SharePoint Farm account and AppPool account. In my environment, I have 02 accounts names SP_Farm and SP_AppPool which I have configured to run SharePoint Farm and AppPools respectively. You need to find out the name of the service accounts for SharePoint Farm Service Account and Application Pool Service Account you configured while you are setting up SharePoint. Once you identify them, perform following instructions to grant right permissions to the database:

  1. Expand Database folder in SQL Server Management Studio.
  2. Expand aspnetdb database.
  3. Expand Security folder and then Users folder.
  4. Right-click Users folder and select New User…
    Capture5
  5. In the Database User – New dialog box, enter name of the farm user for the User name: field and name of the login for the Login name: field.
  6. From the Database role membership: list select the following database Role Members:
  1. aspnet_Membership_FullAccess
  2. aspnet_Personalization_FullAccess
  3. aspnet_Profile_FullAccess
  4. aspnet_Roles_FullAccess
  5. aspnet_WebEvent_FullAccess
    Capture6
  • Select OK to add the user to the database.
  • Repeat steps 4 through 7 for granting SharePoint AppPool service account as well.

Phase 2: Populating the user store with users and roles

Next we need to get some sample users in to the new user store we created by using a role provider. Easiest way to do this is using a Visual Studio ASP.NET Web Site.

Task 1: Creating Users and Roles in custom user store

  1. Fire up Microsoft Visual Studio 2010 by navigating to Start -> All Programs -> Microsoft Visual Studio 2010 -> Microsoft Visual Studio 2010.
  2. Select File -> New -> Web Site…
  3. Select the language of your choice. Select ASP.NET Web Site project template. Provide a project name and click OK.
    Capture7
  4. Double-click web.config from the Solution Explorer and replace <connectionStrings /> with the following:
    <connectionStrings>
        <clear/>
        <add name="LocalSqlServer" connectionString="Data Source=(local);Initial Catalog=aspnetdb;Integrated Security=True"/>
    </connectionStrings>
  5. Make sure to change the highlighted connection string as per your environment to point to the new user store created.
  6. Save web.config file.
  7. Select the ASP.NET Configuration option from the Solution Explorer to open the ASP.NET Web Site Administration Tool.
    Capture8
    Capture9
  8. Go to Provider tab and click “Select a single provider for all site management data” link. Click the link “Test” in front of “AspNetSqlProvider” and make sure you receive a successful response message “Successfully established a connection to the database.”.
  9. Navigate to Security tab. Click “Select authentication type” link from Users section. Change the selection to “From the internet” and click Done.
  10. Select “Enable roles” link from the Roles section to enable role management.
  11. Select “Create user” link from Users section to create required number of users in the user store.
    Capture10
    Capture23
  12. Select “Create or Manage roles” link from Roles section to create roles. Enter Admins for the New role name: field and click Add Role. Add another role named Users following same steps.
    Capture12
  13. Select Manage for the Admins role and search for the Admin user and make sure he is a member of the Admins role. Repeat the same steps to include Sam and Joy users as a member of Users role.
    Capture13
    Capture14
    Capture15

Use steps 11 through 13 to setup the required users and groups in your user store depending on the requirement.

Phase 3: Creating a new Web Application

After we setup our custom user store with the required users and groups, we can start wiring it to the web application.

Task 1: Creating a Web Application to support FBA

  1. Fire up the SharePoint 2010 Central Administration site.
  2. Select Manage web applications from Application Management section.
  3. Click New from the Contribute group of the ribbon to create a new web application.
  4. In the Create New Web Application dialog, select Claims Based Authentication as the option for Authentication. Provide a meaningful name for the Name and provide a valid port for the Port in the IIS Web Site section.
    Capture16
    Capture17
  5. Move down to Claims Authentication Types section and select Enable Forms Based Authentication (FBA) and provide following for Membership and Role providers: (these information can be obtained from machine.config file).
  1. ASP.NET Membership provider name: AspNetSqlMembershipProvider
  2. ASP.NET Role manager name: AspNetSqlRoleProvider
    Capture18
  • Go down to section Sing In Page URL section and if you wish you can configure a custom Sign in page instead of using built-in sign in page. I will use the built-in sign in page for this demo.
    Capture19
  • Leave rest of the fields as it is and click OK to create the new web application.
  • After a few seconds/ minutes, you will get the Application Created dialog box confirming web application creation. Click the link “Create Site Collection” to create a new Site Collection in this new web application.
  • Give a Title and Description in the Title and Description section.
  • Select Team Site template from the Template Selection section.
  • Specify the Farm Administrator name for the Primary Site Collection Administrator field for being able to login using Windows Authentication. I provided my farm administrator account CONTOSO\Administrator for the same.
  • Click OK to create the Site Collection.
  • Click OK to navigate away from the Top-Level Site Successfully Created dialog box.

Task 2: Verify that the new Site Collection can be access using Windows Authentication

Before we proceed, let’s make sure that we can login and access the new site collection using Windows Authentication since we selected both the options while we were creating the Web Application.

  1. Enter the URL of the new Site Collection. In my case, http://teamserver:8080
  2. You will be taken to the default sign in page.
    Capture20
  3. Select Windows Authentication from the drop down and make sure you get access to the new site collection we just created.

Phase 4: Configuring Security Token Service, CA & FBA Web Application

We need to configure Membership provider for Security Token Service in order to FBA to work properly using Claims based authentication in SharePoint 2010.

Task 1: Configuring STS

  1. Fire up the IIS Manager by navigating to Start -> Administrative Tools -> Internet Information Services (IIS) Manager.
  2. Expand the IIS Server and expand the Sites folder.
  3. Expand SharePoint Web Services Web Site.
  4. Right-click SecurityTokenServiceApplication web site and select Explore.
    Capture21
  5. Open the web.config file.
  6. Go to the end of the file and locate the </system.net> element. Just after the </system.net> element, copy the following configuration elements:
    <system.web>
        <membership>
            <providers>
                <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
            </providers>
        </membership>
        <roleManager>
            <providers>
                <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
            </providers>
        </roleManager>
    </system.web>
    <connectionStrings>
        <clear/>
        <add name="LocalSqlServer" connectionString="Data Source=(local);Initial Catalog=aspnetdb;Integrated Security=True"/>
    </connectionStrings>
  7. Save the changes to web.config file.

Task 2: Configuring FBA Web Application

  1. Fire up the IIS Manager by navigating to Start -> Administrative Tools -> Internet Information Services (IIS) Manager.
  2. Expand the IIS Server and expand the Sites folder.
  3. Right-click FBA enabled web application you created earlier in Phase 3 and select Explore. In my example, FBA Web Site – 8080.
    Capture27
  4. Open the web.config file.
  5. Locate the <membership defaultProvider="i"> element and within <providers> </providers> add the following just below existing content:
    <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
  6. Just underneath the Membership provider, locate the <roleManager defaultProvider="c" enabled="true" cacheRolesInCookie="false"> element and within <providers> </providers> add the following just below existing content:
    <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
  7. Finally, locate the </system.web> element and just underneath that, add the following:
    <connectionStrings>
        <clear/>
        <add name="LocalSqlServer" connectionString="Data Source=(local);Initial Catalog=aspnetdb;Integrated Security=True"/>
    </connectionStrings>
  8. Save the changes to the web.config file.

Task 3: Configure CA – Optional

  1. Fire up the IIS Manager by navigating to Start -> Administrative Tools -> Internet Information Services (IIS) Manager.
  2. Expand the IIS Server and expand the Sites folder.
  3. Right-click SharePoint Central Administration v4 site and select Explore.
  4. Open the web.config file.
  5. Search for <roleManager></roleManager> and <membership></membership> elements and you will typically see a set of empty elements for the same. Replace those empty elements with the following:
    <membership>
        <providers>
            <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
        </providers>
    </membership>
    <roleManager>
        <providers>
            <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
        </providers>
    </roleManager>
  6. And just underneath the </system.web> element, enter the following:
    <connectionStrings>
        <clear/>
        <add name="LocalSqlServer" connectionString="Data Source=(local);Initial Catalog=aspnetdb;Integrated Security=True"/>
    </connectionStrings>
  7. Save the changes to web.config file.

Phase 5: Test to see whether FBA works

Before we test to see whether FBA works, we need to make sure Windows Authentication works as earlier and grant access to one of the Forms based user account to site.

Task 1: Verify that the new Site Collection can be access using Windows Authentication

  1. Enter the URL of the new Site Collection. In my case, http://teamserver:8080
  2. You will be taken to the default sign in page.
  3. Select Windows Authentication from the drop down and make sure you get access to the new site collection we just created.

Task 2: Grand access to Forms based users

  1. While you are logged in as Administrator using Windows Authentication, select Site Actions -> Site Permissions.
  2. Select Grant Permissions from the Grant group in the ribbon.
  3. In the Grant Permissions dialog box, select the Browse button.
    Capture22
  4. In the Select People and Groups – Webpage Dialog, enter forms based user name in the Find field and click Search button. I’m searching for Joy user which I created earlier in Phase 2.
  5. You will see Joy user comes under User: Forms Auth category. Select the user and click Add -> button and click OK.
    Capture24
  6. Select the Contribute group from the Grant Permission dialog box and click OK.

Task 3: Test to see whether we can login using FBA

  1. Open a new browser window and enter the URL of the new Site Collection. In my case, http://teamserver:8080
  2. You will be taken to the default sign in page.
  3. Select Forms Authentication from the drop down and it will take you to a sign in page in which you can enter user name and password.
  4. Enter user name and password for the forms user and click Sign In button.
    Capture25
  5. Wow, you have now logged in as Joy who is a forms based user.
    Capture26

Closing Note: It’s going be bit difficult when you configure Forms-based Authentication for the first time but once you have experience doing it few times, you will not face any issues.

21Jul/110

Introducing Edit Control Block (ECB)

Posted by Joy

Most of us who use SharePoint product have been using following menu a number of times. But how did you refer to this menu? How do you call this menu? I have heard people call this menu as "this drop down menu", "this document specific menu", "this item specific menu", "this document edit menu", "this item edit menu", etc…

What is the actual name for this flying menu when you click the down arrow next to the item/ document Name?

This is called "Edit Control Box (ECB)". Now onward, you guys should get used to using this right name instead of calling it "this menu", "that menu", etc…

Edit Control Block (ECB)

Edit Control Block (ECB)

30Jun/110

Service Pack 1 for SharePoint 2010 Products is Now Available for Download

Posted by Joy

Service Pack 1 for SharePoint 2010 Products is Now Available for Download.

Service Pack 1 includes stability, performance, and security enhancements that are a direct result of customer/ partner feedback. Read more about installing Service Pack 1 for SharePoint Foundation 2010, SharePoint Server 2010 and Language Packs from the SharePoint Team Blog.

SharePoint Team Blog: http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?pID=984

Download Service Pack 1: http://technet.microsoft.com/office/ee748587.aspx