Tuesday 27 December 2011

An unhandled exception occurred in the Silverlight Application

If you get an error "An unhandled exception occurred in the Silverlight Application in SharePoint 2010" when you try to create a document library, list, site or anything in SharePoint 2010.

I got this error in my environment when i created Picrure Library in Team site.
Genrally it could be that security validation has been disabled in Webpart Security Validation(Central Administration--> Web Application--> General Settings).


For detailed explanation please find this link

How to Upload multiple files & assign to users in an easy way

Uploading multiple documents and displaying those documents which are assigned to current logged in user only.

For this type of requirment you need to create new column as "Assigned To" in Library with People and Groups column type.

Then goto the Modify view 

Select the "Show items only when the following is true:" radio button  in Filter column and show the items view as per you need.


While i am uploading single file and assigning to user is all doing fine.

But when i am going to upload Multiple documents, in this view am not having "Assigned To" column.
So if you need this column in form view you need to change view for Upload.aspx sharepoint page from /layouts/ folder.

After much research i decided to do this in another way.
Without using Upload Document and Upload Multple Documents menus from sharepont ribbon Library tools,
For Uploading bulk of files and assigning to users  in an easy way you can follow below steps.
  1. By click on the 'Open with Explorer' feature in sharpoint ribbon Library Tools we can copy all the document or any data from our local device to sharepont library.

So now you have all documents in your document library, Now you need to assign them to users.
  1. Click on "Data Sheet View" feaure in library tools, it will take you to below view. Then you can make your changes very easily.

If Data Sheet View feature not visible to you in your site library tools, then you need install "Microsoft Office Access Web Datasheet Component" For insatalling please follow the steps in from this link 

Wednesday 21 December 2011

Moving Active Directory users into SharePoint Site Groups

For moving all the Active Directory users into SharePont 2010 Groups,
Groups are Active Directory objects that can contain users,contacts,computers and other groups.

Active Directory will have two types of Groups.

One is Distribution Group
  1. Distribution groups have only one function - for e-mail distribution lists.  and that is not security-enabled.
  2. Distribution groups cannot be listed in discretionary access control lists (DACLs), which are used to define permissions on resources and objects.
  3. Distribution groups play no role in security (you do not assign permissions to distribution groups), and you cannot use them to filter Group Policy settings.
  4. Distribution Groups are designed to work with email, but not for the assignment or control of permissions to a resource. 
Second one is Security Group
  1. Security group   A group that can be listed in DACLs. A security group can also be used as an e-mail entity.
  2. You can use security groups to control permissions for your site by adding security groups to SharePoint groups and granting Permissions to the SharePoint groups. You cannot add distribution groups to SharePoint groups, but you can expand a distribution group and add the individual members to a SharePoint group.
  3. This type of group has a unique characteristic in that it has a Security Identifier (SID) assigned to it from Active Directory. This SID enhances the function of the group so that it can be used for assigning and controlling permissions to a resource.
1. From Site-->Site Actions-->click on Site Permissions. In this permissions page click on Gran Permissions at top most left corner and give the Acite Directory Security Group Name. In my enviroment added "Domain Users" group.

If you want to add AD group to particular SharePoint Group(Members,Viewers,Ownes,Desingers) then goto the Site Permissions--> click on the SP Group--> here add your Group.


In case if you want to add different types of security groups to sharepoint site :
Then, Create Security Groups as per permission levels like Domain Members, Domain Viewers, Domain Owners, Domain Visitors ...etc., and then assign the members to this groups.(Active Directory Users and Computers--> created Securitygroup-->properties-->members tab)


So that you can add these security groups into sharepoint site,
Sharepoint Site-->Site Actions-->click on Site Permissions link then add the Security groups to related sharepoint permission level site groups.
By adding security group into sharepoint site, all secrity group members will get the particular sharepoint group permissions.

Monday 12 December 2011

Configuring Out going Email settings in SharePoint with Gmail SMTP server

Last week, I configured Form Based Authentication and for User Mangagement i used codeplexfba project.

After finished all settings, I realized that I need to test send mail(Information sending to registered users for Membership Approving,Pending,Password Changing.....etc) functions. As you may know, I need to configure outgoing e-mail settings from SharePoint Central Administration with existed mail server.

The solution I used my Gmail account to send and receive email from my local SharePoint server via MailServer, it is a free e-mail server for Microsoft Windows. It’s used by Internet service providers, companies in all parts of the world.

It supports the common e-mail protocols (IMAP, SMTP and POP3) and can easily be integrated with many existing web mail systems. It has flexible score-based spam protection and can attach to your virus scanner to scan all incoming and outgoing email.

Prerequisites:

1. Create and setup a Gmail account at http://www.gmail.com/
2. Enable the Gmail account for POP3 in Gmail, you can follow the instructions on how to do this here:

To configure the SMPT server:
    Go to Control Panel, click on Turn Windows features on or off, go to Features, click Add Features, select SMTP Server from the list, click Add Required Role Services, click Next (a few times), click Install

or Go to Start,Administrative Tools,Select Server Manager go to Features,

click Add Features, select SMTP Server from the list, click Install.


If SMTP Feature installation sompleted successfully, SMTP feature will be add to IIS 6.0 Manager. SO now


Open Internet Information Services (IIS) 6.0 Manager under Administrative Tools,

expand the node with your local computer name on it, right click on SMPTP Virtual Server and go to Properties SMTP Virtual Server,

In SMTP Virtual Server click the Access tab, click on Relay …, select All except the list bellow and click OK

Click on the Delivery tab, click on Outbound Security,
On the new window that opens select Basic Authentication and type your Gmail (or Google Apps) email and password in the Username and Password fields, and also select TLS encryption


Again now click On the Delivery tab, click Outbound connections… and in the new window that opens change TCP port to 587
Once again in the Delivery tab, click on Advanced and in the new window that opens, in the Smart host field type smtp.gmail.com and click OK


click Apply, click OK

Make sure POP is enabled for your Gmail account (it will be in under Mail Settings -> Forwarding and POP/IMAP).

To configure SharePoint server to send emails through Gmail:

Open SharePoint Central Administration, go to System Settings, go to Configure outgoing e-mail settings     type your computer name in the field Outbound SMTP server and     type your Gmail email address in field From address



Now reset the IIS, Open " Run " command and type iisreset and click enter

And now Open the IIS 6.0 Manager and Start the Configured SMTP Server.

We can check about Out going Email settings for a particular web appllication, Go to Central Administration Site --> Application Management


Thursday 1 December 2011

Central Admin displaying blank page when some authentication providers not installed in IIS

Some times we will get blank page when we are trying to access SharePoint 2010 Central Admin site.

It may cause of mechine have not installed some authenticatin providers during ShaerPont 2010 installation in windows 7 mechine.
We can check the authentication providers list from IIS--> Central Administratio site-->Authentication .

In my SharePoint environment i found this blog , by followint this link i got the central admin page.

Wednesday 30 November 2011

Configuration of Forms Based Authentication for SharePoint 2010


I have much researched about configuring Forms Based Authentication by viewing different blogs. After i succeed, i have decided to write the detailed stepts with related troubleshooting in this blog.

In this blog, you will create a SQL Server database to hold users and roles, create a SharePoint Web Application that uses FBA, configure IIS and the web.config files for the Web App, Central Admin and the Security Token Service, create a test user in the database and test your setup.

SharePoint 2010 supports FBA, Like WSS 3.0 or MOSS 2007. It's a feature of ASP .Net which we use with SharePoint. SharePoint 2010 you can create web applications using Classic Based Authentication or Claims based Authentication. 
However, FBA can only be configured with web applications created using Claims Based Authentication.

Differences between Classic Mode Authentication and Claims based Authentication ?

Classic Mode Authentication: It refers to the integrated windows authentication. You cannot configure the Forms based authentication 
If your web application is using Classic Mode Authentication. You can convert a web application from Classic Mode Authentication to Claims Based Authentication. However, that can only be done using Power Shell commands and its an irreversible process. I have detailed steps to convert the web application from Classic Mode authentication to Claims Based Authentication.

Claims Based Authentication: SharePoint 2010 is built on Windows Identity Foundation. It enables authentication from windows as well as non-windows based systems. This also provides the capability to have multiple authentication in a single URL.

Configuration of FBA with SharePoint 2010 involves 5 major steps. The steps to configure the FBA with SQL membership Provider are 

below:

1. Configure SQL for membership store
  • Create database
  • Create SQL User
  • Add SQL user to database

2. Configure Central Admin to use SQL membership store -  Modify web config file

3. Configure Secure Store Web Service to use SQL membership store - Modify web config file

4. Create new Web Application for extranet site

5. Configure Extranet site to use SQL membership store - Modify web config file

1. Configure SQL for membership store :

The membership store is still created using the ASP.NET SQL Server Setup Wizard.  This is launched from the .NET 2.0 Framework folder 

on the server at:

C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_regsql.exe

This wizard will take you thorough the steps and will build out the SQL database for you.



Once you select to Configure SQL Server for application services, you will be prompted for the SQL Server name and database name. You can choose an existing database to add the membership elements to, or you can type in a new name and the database will be created for you.

Once the database is created, we’re going to create and add a SQL user, rather than use integrated authentication.
 If your SQL instance is not already running in mixed-mode, you can change it through Server properties in SQL Server Management Studio.  Right-click on Server in Object Explorer and select Properties, then navigate to the Security page.

Create SQL User :
In this case, we’ll be using SQL Server authentication. So create a new Login on the SQL Server. From SQL Server Management Studio, use the Object Explorer to navigate to the Security → Logins folder. Right click on the Logins folder to open the context menu and choose the menu item New Login…
This will open the Login – New dialog. Here, you specify a Login name, i.e. FBAService and a SQL Server authentication password, i.e. pwd. You can set your membership provider database as the Default database. Click OK to add the user. It will now show up in the list of logins.




To give the login access to the database, locate the database in the Object Explorer, under the Databases folder and expand the folder Security. Open the context menu from the Users folder and choose the option New User…

This opens the Database User – New dialog.

In this dialog, specify a name for the user and insert the login name that you created earlier (i.e. FBAService) in the Login name text field.

Assign the following Database roles to the user:

give the role as “db_owner”.
Click the OK button to add the user to the database.



To recap:

We created a database called aspnetdb.
We created a SQL user called FBAUser
We added FBAUser to aspnetdb database and gave them the db_owner role.
We’re done with SQL.

2. Configure Central Admin Web Site to use SQL Membership Provider


SharePoint web sites out of the box are configured to use Active Directory.  So you may be wondering why we’re configuring Central Admin to use FBA when we don’t really want to login in as an FBA user.  Well, we actually don’t want to configure it to login as a forms user, but we do need to be able to add users from out membership database when configuring site collection admins, and the like.

So all we want to do is tell the Central Admin web application to use our SQL membership provider as well as AD, so when you use the people picker to select users, it will provide results from our membership database.

Open IIS Manager on the WFE server (if more than one, then this needs to be done on every FWE that has Central Admin.  The same goes for the proceeding steps for the other web applications).

Select the SharePoint Central Administration v4 site.  On the Home Page, you’ll see many options for ASP.NET and IIS.  The ones we’re concerned with are

Open the Connection Strings Page.  Under Actions menu on the right, select Add… to create a new connection string.  Provide the details for the membership database for the new connection string.
In the web.config, you’ll see sections for the connection string. You should also see a <connectionStrings> section close to the bottom of the web.config file. like as below


Add Role Provider:

Go back to the Web Application page and open up Providers page.  Here we will create a provider for Roles and Users. In top most left Set feature to .NET Roles and click Add… in the Actions pane to add a new role provider.  I called it FBARoleProvider and selected the right type and connection string.

Ensure you provide an ApplicationName so the provider knows what uses to authenticate.  For a good explanation on why you need this, see Scott Guthrie’s blog.



Add Membership Provider:

Now set feature to .NET Users and click Add… from the actions pane to add a membership provider.

Select the correct type and connection string, and whatever behaviors you choose.
That’s it for the providers for Central Admin.
To verify that all looks ok, we can check the web.config of the web application.  To get to the right web.config, right-click on the web application(Central Administration) under sites, and select Explore.

In the web.config, you’ll see sections for the connection string. You should see a <roleManager> and <membership> section of the web.config file. like as below

3. Configure Secure Store Web Service to use SQL Membership Provider

Everything we did for Central Admin site, we are going to do for the SecurityTokenServiceAppliaation which is in the SharePoint Web Services application.

do Same as what we did for Central administration site

Create the connection string
Add the .NET role provider
Add the .NET users provider
Verify connection by editing config.xml.



In the web.config, you’ll see sections for the connection string and the providers.  The <connectionStrings> <roleManager> and <membership> sections should look like:


4. Create Extranet Web Application

Finally we are ready to create our web application (called SharePoint – FBA) that will use FBA authentication.

In Central Admin, Select the Application Management page, and select Manage web applications.  Select New from the ribbon to create a new web application.
Select Claims Based Mode Authentication as Authentication Type.  Select values for all the other options until you get to the “Enable Forms Based Authentication”.

Add the values we created earlier in the section “Enable Forms Based Authentication” for role - FBARoleProvider and membership provider - FBAMembershipProvider.

Once the application is created, we should create a site collection.


Create Site Collection

Go to the Create Site Collection page from the Manage Applications section in Central Admin.  Select the team (or blank, or whichever you choose) template then select the site collection administrator. 


Configure Membership Providers for Web App through IIS

In IIS Manager, browse to the new site SharePoint – FBA. For our new FBA site we need to do the following:
Again same what we did before

  • Add connection string
  • Add Providers for members and roles
  • Configure .NET Roles
  • Configure .NET Users
  • Set Authentication to Forms and Integrated
  • Add User as Site Collection Admin



1. 1. Add Connection String     -   Same as we have done before.

2. Add role and user providers -   Again, same as what we did before.  Open Providers page and add an entry for our role and user providers.

3. Configure .NET Roles
This and the next steps are not required for the other two web applications we configured (Central Admin and SSS).
Open the .NET Roles page for our web application.  You will receive a warning that the default role provider is not trusted.

This and the next steps are not required for the other two web applications we configured (Central Admin and SSS).

Open the .NET Roles page for our web application. You will receive a warning that the default role provider is not trusted. WE just need to set our default role provider from 'C' to 'FBARoleProvider'


We do not have any roles in our database at this point, so let’s create two (StandardUser, SuperUser) by clicking Add… in the actions pane.






4. Configure .NET Users
Assuming you don’t let’s add some. Click Add… from the Actions pane to add users, and assign them roles.

Now we need to do the same for .NET Users. Open the .NET Users page. You will get a similar warning saying the default is not

trusted. Set the default provider to FBAMembershipProvider. If you had members in the database, you would now see them listed.



Assuming you don’t let’s add some. Click Add… from the Actions pane to add users, and assign them roles.




5. Set Authentication

SharePoint should have done this when you created the web application, but let’s confirm. From the web application home page in IIS Manager, select Authentication under the IIS section. Confirm that the web application has both Integrated and Forms enabled.


6. Add User as Site Collection Admin

Now that we have everything hopefully configured correctly, we can go back to SharePoint Central Admin and add our new FBA user as the Site Collection Administrator.  From Central Admin Application Management page, click Change site collection administrators.  Select SharePoint – FBA root site collection, and add our new user.

In order for you to use IIS Manager to manage your SQL users, you need to set the default provider to our Forms provider, i.e. FBAMembershipProvider.  In order for it to work we need to set it to the SharePoint claims provider.  Go back to .NET Users and reset the default provider from ' FBAMembershipProvider ' to ' i ' ,  and Reset the default provider from 'FBARoleProvider' to ' c '.



Monday 28 November 2011

Compare SharePoint 2007 – SharePoint 2010 development

SharePoint 2007SharePoint 2010

ENVIRONMENT
Windows Server 2003 or
Windows Server 2008

32 bit or 64 bit

.NET 3.0 (IIS 6.0 above)

WSS 3.0

MOSS 2007
Windows Server 2008 or 2008 R2 (Production), W4indows 7 or Vista SP2 (dev)

64 bit 64 bit only

.NET 3.5 and above, IIS 7.0

SharePoint Foundation 2010 (SPF)

SharePoint Server 2010

WORKLOADS OR FUNCTIONAL AREAS

SharePoint provisioning & Collaboration lists

Wikis, blogs, user profiles, my sites














Excel Services
SQL Reporting services Performance
Point Add-On



BDC


Sites

Communities
Social networking
Enterprise metadata tagging

Content
WCM
ECM
DM
RM

Search
Built in search
FAST Search (enterprise)
FAST Search Center

Insights
Excel Services
Performance Point Services
Cohesive BI integration
Reporting

Composites
Business connectivity
services (CRUD)
External content type


IMPROVEMENTS

Visual Studio 2008 (Visual studio extensions
for wss 3.0 & codeplex utilities)

.NET Framework 3.5

stsadm command line

No LINQ support (caml support)

Full HTTP Requests (postback)





no need to write CAML queries

Workflow on lists and documents

New MOSS to access External data

SSPs



Solution Package

Visual Studio 2010 (SharePoint projects, SharePoint explorer)

.NET Framework 4.0

PowerShell scripts (stsadm backward compatibility)

WSS Integration with LINQ

Ajax requests & SilverLight support
Server-side ribbon and In-Place editing

Improvements to Lists and Events (events for child site, large lists, throttling)

New client object model

Workflows on sites

External data can be accessed with SPF

SPF support Service applications
extensible Service Application architecture,
Scalability

Sandbox Solutions and Partially trusted code,
build solution and upload to site collection

Claims based security (saml support, support Live ID)

Developer Dashboard
request run-time length
even handlers fired
sequence of event handlers

SPD improvements
SPD objects have relationships
Intuitive navigation between SPD objects
SPD work migrates to Visual Studio 2010
SPD customization work exported to .wsp
.wsp files imported into Visual Studio 2010
Reusable workflows (customization)
Site Workflows (Workflow designer)

PowerShell Support
Replaces stsadm
powerful scripts
develop custom PowerShell
snap-ins (provider-based model) Microsoft.SharePoint.PowerShell

Terminology review (still remains the same)

Farm (SPFarm)

Web Application (SPWebApplication)

Site Collection (SPSite)

SPSite (SPWeb)

List (SPList)
Item (SPListItem)

Document Library (SPDocumentLibrary)

File (SPFile)

Folder (SPFolder)

Sunday 27 November 2011

Menimum requirements to install SharePoint 2010

Here are 10 menimum requirements to install SharePoint 2010.

Though Microsoft SharePoint 2010 provides a lot of installation schenerious, we will discuss some minimum hardware and software requirement to install SharePoint 2010.


1. The first requirement is we will need 64 bit processor not 32 bit.
2. RAM of 4GB for development use and 8 GB for production use.
3. Minimum 80GB hard disk needed.
4. Needed 64-bit edition of Microsoft SQL Server 2008 R2 (Preferable)
5. 64-bit edition of Windows Server 2008 R2 preferable
6. Microsoft .NET Framework version 3.5 SP1
7. Microsoft Chart Controls for the Microsoft .NET Framework 3.5 (You need to install this patch before SharePoint 2010 installation)
8. Windows PowerShell 2.0
9. For Windows Server 2008 R2, Windows6.1-KB979917-x64.msu patch is necessary before SharePoint 2010 installation
10. Microsoft SQL Server 2008 Native Client. This can be downloaded from http://go.microsoft.com/fwlink/p/?LinkId=166505

Saturday 26 November 2011

How to get the assembly name of a custom web part in SharePoint 2010?

Here the way you can get the 4 part assembly name of your custom web part.

First of all add the web part to the SharePoint site by edit the page and click on the add a web part link on your web part zone. Once you will add the web part, go to Edit web part as shown in the figure below.


Then from the web part properties go to Advance and then in the Export mode Select Export all data as shown in the figure below.


Then click on OK.
After that click on Export... as shown in the figure below.

Then it will ask you to save the web part. Just save the webpart and after that open that file in notepad. It will give you everything about the webpart.

I got this information from OnlySharePoint2010