Jun 19 2011

Most Common Custom WebParts Parts

Category: Sharepoint 2010Abhishek Shukla @ 18:50 | |
http://www.fivenumber.com/most-common-custom-webparts-part1-tree-view-webpart-shows-sites-and-sub-sites/

Original post location with due credit to post owner

I desired to support most common custom webparts used by the SharePoint professional, so that these can be helpful for them.

A custom tree view webpart shows all the sites and sub-sites of a SharePoint site

SharePoint Custom Tree View WebPart

SharePoint Custom Tree View WebPart

Please use the below code and to get the exact look as show in the aboave image, the tree view webpart can expand/collapse

using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
 
namespace CustomWebParts.CustomTreeView
{
    [ToolboxItemAttribute(false)]
    public class CustomTreeView : WebPart
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
        //private const string _ascxPath = @"~/_CONTROLTEMPLATES/CustomWebParts/CustomTreeView/CustomTreeViewUserControl.ascx";
 
        TreeView myTree;
        LinkButton lnkBtnExpand;
        LinkButton lnkBtnCollapse;
        Label lblPipeDivider;
        Label lbl_ErrorMsg;
        private string errorMessage = string.Empty;
        private int level = 0;
 
        protected override void CreateChildControls()
        {
            //Control control = Page.LoadControl(_ascxPath);
            //Controls.Add(control);
 
            this.Controls.Clear();
            myTree = new TreeView();
            myTree.ExpandImageUrl = "/_layouts/images/tvplus.gif";
            myTree.RootNodeStyle.ImageUrl = "/_layouts/images/stsicon.gif";
            myTree.ParentNodeStyle.ImageUrl = "/_layouts/images/stsicon.gif";
            myTree.LeafNodeStyle.ImageUrl = "/_layouts/images/stsicon.gif";
            myTree.CollapseImageUrl = "/_layouts/images/tvminus.gif";
            myTree.NoExpandImageUrl = "/_layouts/images/stsicon.gif";           
 
            myTree.NodeWrap = true;
            myTree.ShowLines = true;
            myTree.ShowExpandCollapse = true;
            myTree.EnableClientScript = true;
 
            GenerateTreeView();
            myTree.CollapseAll();
            myTree.CssClass = "ms-navitem a";
            this.Controls.Add(myTree);
 
            lnkBtnExpand = new LinkButton();
            lnkBtnExpand.Click += new EventHandler(expandAll_Click);
            lnkBtnExpand.Text = "Expand all";
            lnkBtnExpand.CssClass = "ms-navitem a";
            this.Controls.Add(lnkBtnExpand);
 
            lblPipeDivider = new Label();
            lblPipeDivider.Text = "  |  ";
            this.Controls.Add(lblPipeDivider);
 
            lnkBtnCollapse = new LinkButton();
            lnkBtnCollapse.Click += new EventHandler(collapseAll_Click);
            lnkBtnCollapse.Text = "Collapse all";
            lnkBtnCollapse.CssClass = "ms-navitem a";
            this.Controls.Add(lnkBtnCollapse);
 
            lbl_ErrorMsg = new Label();
            this.Controls.Add(lbl_ErrorMsg);
 
            base.CreateChildControls();
        }
 
        private void GenerateTreeView()
        {
            SPSite mySite = null;
            SPWeb myWeb = SPContext.Current.Web;
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                try
                {
                    mySite = new SPSite(myWeb.Site.ID);
                    using (mySite)
                    {
                        level = 1;
                        foreach (SPWeb subWeb in myWeb.Webs)
                        {
                            TreeNode myTreeNode = new TreeNode(subWeb.Title);
                            myTreeNode.NavigateUrl = subWeb.Url;
                            ReadSubSites(subWeb, ref myTreeNode);
                            myTree.Nodes.Add(myTreeNode);
                        }
 
                    }
                }
                catch (Exception ex)
                {
                    errorMessage = ex.ToString();
                }
            });
        }
 
        private void ReadSubSites(SPWeb subWeb, ref TreeNode myTreeNode)
        {
            try
            {
                foreach (SPWeb myChildSubWeb in subWeb.Webs)
                {
                    TreeNode subnode = new TreeNode(myChildSubWeb.Title);
                    subnode.NavigateUrl = myChildSubWeb.Url;
 
                    myTreeNode.ChildNodes.Add(subnode);
 
                    if (myChildSubWeb.Webs.Count > 0)
                    {
                        if (myTreeNode.ChildNodes.Count > 0)
                        {
                            level = level + 1;
                            TreeNode myChildNode = myTreeNode.ChildNodes[myTreeNode.ChildNodes.Count - 1];
                            ReadSubSites(myChildSubWeb, ref myChildNode);
                            level = level - 1;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.ToString();
            }
        }
 
        void expandAll_Click(object sender, EventArgs e)
        {
            myTree.ExpandAll();
        }
 
        void collapseAll_Click(object sender, EventArgs e)
        {
            myTree.CollapseAll();
        }     
 
        protected override void RenderContents(HtmlTextWriter writer)
        {
            EnsureChildControls();
            lnkBtnExpand.RenderControl(writer);
            lblPipeDivider.RenderControl(writer);
            lnkBtnCollapse.RenderControl(writer);
            RenderChildren(writer);
        }
    }
}

Most Common Custom WebParts Part 2 – Menu WebPart Shows Sites and Sub-Sites in Fly-Out Mode

From last post I want to continue the series of most commonly used custom webparts, so once again I come up with a simple and small custom menu webpart shows all the sites and sub-sites of a SharePoint site in fly-out style

SharePoint Menu WebPart in fly-Out Style

SharePoint Menu WebPart in fly-Out Style

using System;
using System.ComponentModel;
using System.Web;
using System.Drawing;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
 
namespace CustomWebParts.VisualWebPart1
{
    [ToolboxItemAttribute(false)]
    public class VisualWebPart1 : WebPart
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
       // private const string _ascxPath = @"~/_CONTROLTEMPLATES/CustomWebParts/TreeView/TreeViewUserControl.ascx";
 
        System.Web.UI.WebControls.Menu menu = null;
 
        protected override void CreateChildControls()
        {
            //Control control = Page.LoadControl(_ascxPath);
            //Controls.Add(control);
 
            menu = new System.Web.UI.WebControls.Menu();
            SPSite site = SPContext.Current.Site;
            SPWeb web = SPContext.Current.Web;
 
            menu.StaticDisplayLevels = 1;
            menu.MaximumDynamicDisplayLevels = 200;
            menu.Orientation = System.Web.UI.WebControls.Orientation.Horizontal;
            menu.StaticEnableDefaultPopOutImage = false;
            menu.StaticPopOutImageUrl = "/_layouts/images/menudark.gif";
            menu.SkipLinkText = "";
            menu.DynamicHoverStyle.BackColor = System.Drawing.Color.FromName("#CBE3F0");
            menu.CssClass = "ms-topNavContainer";
 
            menu.StaticMenuItemStyle.ItemSpacing = Unit.Pixel(0);
            menu.StaticSelectedStyle.CssClass = "ms-topnavselected";
            menu.StaticHoverStyle.CssClass = "ms-topNavHover";
 
            menu.DynamicMenuStyle.BackColor = System.Drawing.Color.FromName("#F2F3F4");
            menu.DynamicMenuStyle.BorderColor = System.Drawing.Color.FromName("#A7B4CE");
            menu.DynamicMenuStyle.BorderWidth = Unit.Pixel(1);
 
            menu.DynamicMenuItemStyle.CssClass = "ms-topNavFlyOuts";
            menu.DynamicHoverStyle.CssClass = "ms-topNavFlyOutsHover";
            menu.DynamicSelectedStyle.CssClass = "ms-topNavFlyOutsSelected";
 
            MenuItemStyle stMenuStyle = menu.StaticMenuItemStyle;
            stMenuStyle.CssClass = "ms-topnav";
 
            stMenuStyle.HorizontalPadding = 0;
            stMenuStyle.VerticalPadding = 0;
            stMenuStyle.ItemSpacing = Unit.Pixel(0);
 
            MenuItemStyle dyMenuStyle = menu.DynamicMenuItemStyle;
            dyMenuStyle.CssClass = "ms-topNavFlyOuts";
            dyMenuStyle.HorizontalPadding = 0;
            dyMenuStyle.VerticalPadding = 0;
 
            System.Web.UI.WebControls.MenuItem mItem = new System.Web.UI.WebControls.MenuItem(web.Title);
            mItem.NavigateUrl = web.Site.Url;
            menu.Items.Add(mItem);
 
            GenerateMenu(menu, Context);
            menu.DataBind();
            this.Controls.Add(menu);
        }
 
        public static void GenerateMenu(System.Web.UI.WebControls.Menu menu, HttpContext context)
        {
            SPSite site = SPContext.Current.Site;
            SPWeb web = SPContext.Current.Web;
 
            foreach (SPWeb subsite in web.Webs)
            {
                System.Web.UI.WebControls.MenuItem mItem = new System.Web.UI.WebControls.MenuItem();
                mItem.NavigateUrl = subsite.Url;
                mItem.Text = subsite.Title;
                mItem.ToolTip = subsite.Title;
                menu.Items.Add(mItem);
                BuildMenu(subsite, mItem, context);
            }
        }
 
        private static void BuildMenu(SPWeb subweb, System.Web.UI.WebControls.MenuItem mItem, HttpContext context)
        {
            SPSite site = SPContext.Current.Site;
            SPWeb web = SPContext.Current.Web;
 
            foreach (SPWeb subsite in subweb.Webs)
            {
                System.Web.UI.WebControls.MenuItem mSubItem = new System.Web.UI.WebControls.MenuItem();
                mSubItem.NavigateUrl = subsite.Url;
                mSubItem.Text = subsite.Title;
                mSubItem.ToolTip = subsite.Title;
                mItem.ChildItems.Add(mSubItem);
            }
        }
    }
}
 


Tags: ,

May 31 2011

Sharepoint 2010 Hand on lab

Category: Sharepoint 2010Abhishek Shukla @ 12:00 | |
All these are collected from Microsoft Page
HOL01 - Developing a Visual Web Part in Visual Studio 2010
HOL02 - Developing a List Definition and Event Receiver in Visual Studio 2010
HOL03 - Developing Advanced Web Parts for SharePoint 2010 with Visual Studio 2010
HOL04 - Developing with LINQ to SharePoint in Visual Studio 2010
HOL05 - Developing for SharePoint 2010 with the Client OM and REST in Visual Studio 2010
HOL06 - Developing a BCS External Content Type with Visual Studio 2010
HOL07 - Developing a SharePoint 2010 Workflow with Initiation Form in Visual Studio 2010
HOL08 - Developing SharePoint 2010 User Interface with Silverlight in Visual Studio 2010
HOL09 - Developing SharePoint 2010 Sandboxed Solutions in Visual Studio 2010
SharePoint2010_Developer_HandsOnLabs_April2010.zip
 
 
 

Tags: ,

May 27 2011

Windows Server 2008 computers hang during startup while "applying computer settings" and services configured to start automatically fail to start

Category: Sharepoint 2010Abhishek Shukla @ 14:33 | |

An interesting event occurred recently in a lab environment of a SharePoint Farm I was working on.


As MSFT support was in their second day of diagnosis I noticed the following Microsoft KB article which mentioned certain essential services such as GP Client, DNS, Etc would not start automatically because of a deadlock between Service Control Manager and HTTP.SYS  - This fit the observed behavior…Let’s try the fix in the KB…

Now for the fix

    1. Boot Into SafeMode
    2. Open Registry Editor
    3. Navigate to HKLM\CurrentControlSet\Services\HTTP and create the following Multi-string value: DependOnService
    4. Double click the new DependOnService value that you created
    5. Enter CRYPTSVC in the Value Data field and click OK
    6. Reboot Server in normal Mode

 

This event took three days from my life, days I can never regain so I offer this seemly simple fix yet buried solution in hopes I can save someone else.

Tags:

May 27 2011

Host and virtual machine hangs / pauses / stops periodically in VMware Workstation

Category: vmwareAbhishek Shukla @ 12:15 | |

I have been a bit anoyed about my host and virtual machines pausing for a few seconds, and pretty frequently. I code on my virtual machine, and all those pauses was hurting my productivity a lot. An old colleague heard at a VMware course that it could be because of the fact that if the computer is dual core and the virtual machine is set to use both cores, then BOTH cores must be available everytime cpu is needed from client. This might be the problem for some, and setting VMware to use 1 CPU core for clients may help, but for me it did not.

I ended up finding the solution online. It’s quite simple – only a line needs to be added to the virtual machine .vmx configuration line. Add the following line:

mainmem.useNamedFile = false

The pauses should stop now, and it does not matter if you use 1 or 2 cores on clients.

From what I read this config line should only change the place the swapped memory for the client is placed, but it did the trick for me somehow. I have read this has helped others too.

Tags:

May 27 2011

VMware: Host Power Management Causes slowdown on virtual machines

Category: vmwareAbhishek Shukla @ 12:13 | |

Common problems for slow virtual machines are CPU throttling caused by the Power Management on host machine, and IO problems.

This will discuss how to avoid the CPU throttling done by Intel SpeedStep and AMD Cool ‘n’ Quiet.

 

1: Find out what your CPU speed is.

If you don’t know rightclick on “My Computer” and click “Properties”.

About 2/3 down it says:

Dell Latitude D630

Intel(R) Core(TM) Duo CPU

T7500 @ 2.20GHz

The 2.2GHz is what we’re looking for.

 

2: Open VMware global configuration fine (config.ini)

Location is:

Windows XP / Windows Server 2000 / 2003:

%AllUsersProfile%\Application Data\VMware\VMware Workstation\config.ini

Windows Vista / Windows 7 / Windows Server 2008:

C:\ProgramData\VMware\VMware Workstation\config.ini

“VMware Workstation” needs to be replaced if that is not the product used.

 

3: Edit config.ini

3 lines needs to be copied to the config.ini file:

host.cpukHz = “2200000″
host.noTSC = “TRUE”
ptsc.noTSC = “TRUE”


The cpu speed is listed in kiloherz, and your CPU is most likely listed in gigaherz where we looked it up.

Multiply the gigaherz with 1.000.000 (1 million) and you have your speed in kiloherz.

The value above is for 2.2 GHz. If you have 2.4 GHz for instance, just replace the “22″ with “24″.

 

4: Make sure time synchonisation is enabled on client.
Double click the VMware tools icon in “Notification Tray” and select the “Options” tab. Make sure “Time synchronization between the virtual machine and the host operating system”

 

5: Restart VMware Authorization service
Click Start -> Control Panel -> Administrative Tools -> Services
Rightclick VMware Authorization and choose Restart

Start up your Virtual Machine now and you should experience better CPU speeds.

Tags:

May 26 2011

SharePoint URL Basics

Category: Sharepoint 2010Abhishek Shukla @ 18:31 | |

Originally Found this post at 


Great post by Laura Rogers (@wonderlaura) on SharePoint911 for beginners and experts.  It breaks down the SharePoint URL space down in a very logical and easy to understand fashion since Microsoft didn’t exactly do that for us.  This is not a developer centric post, although I did request that Laura consider writing one.  Be sure to check-out Laura’s Blog by clicking on the title link above.

In SharePoint, it often helps to know the basics of how things are structured, and what the standard syntax of URLs is.  When explaining concepts to newcomers, I often take for granted that URLs are obvious, but they’re not if you’re not used to paying attention to them.  In this post, I’ll quickly go over some basics of a SharePoint URL structure, geared toward SharePoint newcomers who want to become power users, or who want to have a bit more advanced knowledge of it.  The first couple of these, like web applications and site collections are really quite technical concepts, with managed paths and such, but I’m going to attempt to water-down and simplify it.

Web Applications:

The beginning of the URL indicates its web app.  It always starts with http:// and then there’s the name of your web app.  For internal sites, this name has most likely been registered in DNS by a System Administrator.  I’ll use the example http://intranet.contoso.com in this blog post, with Contoso being the company’s domain name.  Most likely if your company has MOSS, you’ve got at least two web apps.  Once for the main intranet, and one for the My Sites, such as http://my.contoso.com.

Site Collections: titlegraphic

A site collection can live at the root level of the web application OR can be at a managed path.  When a site collection is at the root of the web app, it’s simply http://intranet.contoso.com. BUT, if the site collection is at a managed path, it will be two levels below, like this: http://intranet.contoso.com/sites/marketing
In this example, the “sites” is the managed path.  (managed paths are set up by administrators in central administration)

Sub-Sites: titlegraphic

Sub-sites are created under site collections.  So, following the example above, a sub-site called “promos” may have the URL of:
http://intranet.contoso.com/promos

OR, it could even be
http://intranet.contoso.com/sites/marketing/promos

Site Collections and Sub-sites will also have something extra, the default.aspx.  This is the main landing page of the site.  So, the full URL of the first example would be:

http://intranet.contoso.com/promos/default.aspx

When sending people the link to the site, or for that manner, linking to it in any way, it is not necessary to include the default.aspx at the end… but it doesn’t hurt.

Document Libraries: dlicon

The URL of a document library can sometimes be confused with the URL of a sub-site.  A library called “Presentations”, under the site called promos (in the first example of sub-sites), will have a URL of:

http://intranet.contoso.com/promos/presentations

But a document library does look a bit different, because of the view part of the URL, which I’ll get into in the Views section below, but here’s what the full URL of the default view of the presentations library would look like:

http://intranet.contoso.com/promos/presentations/Forms/AllItems.aspx

Within document libraries, the document URLs consist of the names of each document.  For Example, if I upload an Excel file called “Project Hours.xlsx” to my “presentations” library, the URL to that file is:

http://intranet.contoso.com/promos/presentations/Project%20Hours.xlsx

Lists:generic

Lists actually do live under a folder called “Lists” in each site, so they’re easy to identify.  A list called “budgets” will have a URL of:

http://intranet.contoso.com/promos/Lists/budgets

And yes, there will always be that default view when you create the list, so the full URL will be:

http://intranet.contoso.com/promos/Lists/budgets/AllItems.aspx

RANT: Notice that there are no strange characters anywhere in these example URLs.  Those little %20 thingies are a major pet peeve of mine.  Each time I create new lists, libraries, views, and even columns, I never use spaces or apostrophes or any weird characters like that.  This makes the URLs ugly (in my opinion).  It does take a few extra seconds of time, and a few extra clicks, but I make it a habit to first create the object with no spaces, and save it, and then go right back in and rename it.  Since the URL is tied to the original name of the list or column or whatever, it will be nice and neat.

Views:

Views in lists and libraries each have their own URL.  When I showed a customer the other day how to create a filtered view in a list, grab the view’s URL, and then use it elsewhere in the site to link directly to that filtered view, this customer thought that was the coolest thing ever.  Basically, each view is a .ASPX file under the URL of the list.  In libraries, there is a “Forms” folder, as you may have noticed in the example above, and in lists, there is no “Forms” folder.  But lists do have that “Lists” folder that exists before the name of the list, as shown above.  Anyway, so for example a tasks list in SharePoint has several default views, each with their own URL, as so:

http://intranet.contoso.com/promos/Lists/Tasks/AllItems.aspx
http://intranet.contoso.com/promos/Lists/Tasks/active.aspx
http://intranet.contoso.com/promos/Lists/Tasks/byowner.aspx

Items:

Each individual item has its own URL, based on the type of form you want to open it in.  There are three default forms in SharePoint:

  • NewForm.aspx – This is the very first form that is used, when creating a new item in a list.
  • DispForm.aspx – This is the display form, to simply display the item after it has been created (as opposed to editing it)
  • EditForm.aspx – This is the form used to edit an item and then save it again.

Another important thing to know, is that every list and library item in SharePoint has its own unique ID, which is unique within that list or library.  The ID is called “ID”, and is created in numerical order as each list item is created.  This ID cannot be changed.  Here is the syntax of the page on which you create a new task in a task list:

Here is the syntax of the very first task created in a task list:

http://intranet.contoso.com/promos/Lists/Tasks/NewForm.aspx

Here is the syntax of the very first task created in a task list, AFTER it has been created, when you’re simply viewing it:

http://intranet.contoso.com/promos/Lists/Tasks/DispForm.aspx?ID=1

Notice that the New Form doesn’t have an ID associated with it.  There is no ID, because the item hasn’t actually been created yet.  It’s not created until you click OK that first time.  Then, when we click “Edit Item”, this is the URL for that same first item (ID=1) that we created in the list:

http://intranet.contoso.com/promos/Lists/Tasks/EditForm.aspx?ID=1

Source:

But Laura, what’s all that &Source=BlahBlahBlah stuff at the end of URLs?

The source is where you’re going to be navigated back to, after the form is filled out, and it’s usually where I came from.  Like what view I was looking at when edited the form.  In this example, I was looking at the “By Owner” (byowner.aspx) view of the tasks list when I clicked to edit an item, and starting with the ampersand, this is what the URL looked like after the editform.aspx?ID=1

&Source=http%3A%2F%2Fintranet%2Econtoso%2Ecom%2Fpromos%2FLists%2FTasks%2Fbyowner%2Easpx

In one scenario, I used this source stuff to my advantage.  I wanted the users to be navigated to a specific URL of my choosing after they filled out a certain form, so I created manual links in this certain site, all hard-coded with the Source information.

GUID:

Oh yeah, I went there.  In each SharePoint site collection, each list and library has a long unique ID.  This does exist in URLs in some places, like list settings.  For example, on a tasks list, I click to go to the list’s settings page, and the URL (after the name of the site) looks like this.  I’ve put the GUID in bold:

/_layouts/listedit.aspx?List=%7BD535FA0E%2D67A6%2D4182%2D9E6A%2D9513B06FB28A%7D

Therefore, when I go to the site here, and decode the URL, I get this:

{D535FA0E-67A6-4182-9E6A-9513B06FB28A}

Okay, okay, I’ll stop.  This post isn’t geared towards developers, so I’m not going to get any more into the nitty gritty here.  I guess if you want to know more about the GUID, you’ll let me know.  ;-)

Hopefully, this has been a helpful and explanatory crash course for SharePoint newcomers who would like to get up-to-speed.

Tags: ,

May 17 2011

Performing Administrative Tasks Using Central Administration (part 2)

Category: Sharepoint 2010Abhishek Shukla @ 08:55 | |
1.2. Using the Web Application Ribbon

In SharePoint 2010, you manage Web applications by going to the Web Application page and using the Web Application Ribbon, as shown in Figure 2. The sections that follow will show how to create, delete, and configure Web applications using the options you can select on this Ribbon.

Figure 2. Web Application Management page


1.3. Creating a Web Application

To create a new Web application, select the New option on the left side of the Ribbon. This opens the Create New Web Application page shown in Figure 3.

Figure 3. Create New Web Application page, Authentication and IIS Web Site sections


The first thing you must do when creating a new Web application is to select the authentication method. SharePoint 2010 introduces a new type of authentication called claims-based authentication, which can be used instead of the classic-mode authentication that is used in earlier versions of SharePoint.

The claims-based authentication model for SharePoint 2010 is built on the Windows Identity Foundation (WIF). Claims-based authentication in SharePoint 2010 enables authentication across Windows-based systems and systems that are not Windows-based by supporting delegation of user identity between applications. Using claims-based authentication, you can implement multiple forms of authentication on a single zone.

The other authentication option available on the Create New Web Application page, classic-mode authentication, refers to the Integrated Windows authentication model supported in previous versions of SharePoint, such as Windows SharePoint Services 3.0. In classic-mode authentication, no claims augmentation is performed, and there is no support provided for the new claims authentication features. Using classic-mode authentication allows you to implement all of the previously supported forms of authentication with a limit of one form of authentication for each zone.

 

When you create a Web application, it will automatically be allocated a random port number, a description field, and a folder location in the default local path. The default path is C:\Inetpub\wwwroot\wss\VirtualDirectories\portnumber. The application is not, by default, assigned a host header name. Therefore, you must specify in the Host Header text box on the Create New Web Application page shown in Figure 6-14 if you want to use a fully qualified domain name such as http://portal.contoso.com to access your Web application. You must ensure that this host header URL can be resolved by your users. Normally, this would be achieved by adding an entry into DNS pointing the URL to the Web server.


Note:

Name your Web application descriptions and paths with a consistent logical naming convention to identify them easily in the folder structure and in IIS. For example, instead of using SharePoint (9845) as the description, use Corporate Portal (9845) and specify the same name for the path and the host header. In addition, name your databases the same way that you name your Web application names so that you have naming consistency across your implementation. In this example, you could name the first database Corporate_Portal_9845_1, then name the second database Corporate_Portal_9845_2, and so forth. You should also name the folder for the Web application files with the same name. Scroll to the end of the path name in the Path text box (refer to Figure 6-14) and replace the default name of the folder with the Web application name.


Scrolling down the Create New Web Application page displays the Security Configurations section as shown in Figure 4.

Figure 4. Creating New Web Application page, Security Configuration and Public URL sections


There are two authentication providers available for a Web application—Kerberos and NTLM. Web applications use these security mechanisms when they communicate with other servers and applications in the network, such as when they communicate with the Microsoft SQL server hosting the databases. By default, the authentication provider is set to NTLM for maximum compatibility with mixed domain models and user account permissions. Figure 6-15 shows the Security Configuration section on the Create New Web Application page. Web applications use these security mechanisms when they communicate with other servers and applications in the network, such as when they communicate with the Microsoft SQL server hosting the databases.

Kerberos is more secure than NTLM, but it requires a service principal name (SPN) for the domain account that SharePoint is using. This SPN must be added by a member of the domain administrators group, and it enables the SharePoint account to use Kerberos authentication.

 

When you choose NTLM, it does not matter what your domain account is, because the application pool will run as long as it has the required permissions to access the SQL server and the Web server. The required SQL permissions for a Web application account are as follows.

  • Database Creator Role

  • Security Administrator

Anonymous access can also be enabled on a Web application, which would enable users to gain access to the sites hosted on the Web application without authenticating. If you choose to do this, however, you also must enable anonymous access on the site itself—enabling it on the Web application only gets the users past IIS authentication. Enabling anonymous access is a useful configuration for any Internet-facing sites, such as a company website.

security, you could also enable SSL certificates on the Web application. You can choose to use certificates from both your internal certificate authority and from an authorized certificate authority such as Verisign. However, you must install the SSL certificate on all servers where users are accessing your Web application or their access attempt will fail.
For added
 

Tags: ,

May 17 2011

Performing Administrative Tasks Using Central Administration (part 2)

Category: Sharepoint 2010Abhishek Shukla @ 08:55 | |
1.2. Using the Web Application Ribbon

In SharePoint 2010, you manage Web applications by going to the Web Application page and using the Web Application Ribbon, as shown in Figure 2. The sections that follow will show how to create, delete, and configure Web applications using the options you can select on this Ribbon.

Figure 2. Web Application Management page


1.3. Creating a Web Application

To create a new Web application, select the New option on the left side of the Ribbon. This opens the Create New Web Application page shown in Figure 3.

Figure 3. Create New Web Application page, Authentication and IIS Web Site sections


The first thing you must do when creating a new Web application is to select the authentication method. SharePoint 2010 introduces a new type of authentication called claims-based authentication, which can be used instead of the classic-mode authentication that is used in earlier versions of SharePoint.

The claims-based authentication model for SharePoint 2010 is built on the Windows Identity Foundation (WIF). Claims-based authentication in SharePoint 2010 enables authentication across Windows-based systems and systems that are not Windows-based by supporting delegation of user identity between applications. Using claims-based authentication, you can implement multiple forms of authentication on a single zone.

The other authentication option available on the Create New Web Application page, classic-mode authentication, refers to the Integrated Windows authentication model supported in previous versions of SharePoint, such as Windows SharePoint Services 3.0. In classic-mode authentication, no claims augmentation is performed, and there is no support provided for the new claims authentication features. Using classic-mode authentication allows you to implement all of the previously supported forms of authentication with a limit of one form of authentication for each zone.

 

When you create a Web application, it will automatically be allocated a random port number, a description field, and a folder location in the default local path. The default path is C:\Inetpub\wwwroot\wss\VirtualDirectories\portnumber. The application is not, by default, assigned a host header name. Therefore, you must specify in the Host Header text box on the Create New Web Application page shown in Figure 6-14 if you want to use a fully qualified domain name such as http://portal.contoso.com to access your Web application. You must ensure that this host header URL can be resolved by your users. Normally, this would be achieved by adding an entry into DNS pointing the URL to the Web server.


Note:

Name your Web application descriptions and paths with a consistent logical naming convention to identify them easily in the folder structure and in IIS. For example, instead of using SharePoint (9845) as the description, use Corporate Portal (9845) and specify the same name for the path and the host header. In addition, name your databases the same way that you name your Web application names so that you have naming consistency across your implementation. In this example, you could name the first database Corporate_Portal_9845_1, then name the second database Corporate_Portal_9845_2, and so forth. You should also name the folder for the Web application files with the same name. Scroll to the end of the path name in the Path text box (refer to Figure 6-14) and replace the default name of the folder with the Web application name.


Scrolling down the Create New Web Application page displays the Security Configurations section as shown in Figure 4.

Figure 4. Creating New Web Application page, Security Configuration and Public URL sections


There are two authentication providers available for a Web application—Kerberos and NTLM. Web applications use these security mechanisms when they communicate with other servers and applications in the network, such as when they communicate with the Microsoft SQL server hosting the databases. By default, the authentication provider is set to NTLM for maximum compatibility with mixed domain models and user account permissions. Figure 6-15 shows the Security Configuration section on the Create New Web Application page. Web applications use these security mechanisms when they communicate with other servers and applications in the network, such as when they communicate with the Microsoft SQL server hosting the databases.

Kerberos is more secure than NTLM, but it requires a service principal name (SPN) for the domain account that SharePoint is using. This SPN must be added by a member of the domain administrators group, and it enables the SharePoint account to use Kerberos authentication.

 

When you choose NTLM, it does not matter what your domain account is, because the application pool will run as long as it has the required permissions to access the SQL server and the Web server. The required SQL permissions for a Web application account are as follows.

  • Database Creator Role

  • Security Administrator

Anonymous access can also be enabled on a Web application, which would enable users to gain access to the sites hosted on the Web application without authenticating. If you choose to do this, however, you also must enable anonymous access on the site itself—enabling it on the Web application only gets the users past IIS authentication. Enabling anonymous access is a useful configuration for any Internet-facing sites, such as a company website.

security, you could also enable SSL certificates on the Web application. You can choose to use certificates from both your internal certificate authority and from an authorized certificate authority such as Verisign. However, you must install the SSL certificate on all servers where users are accessing your Web application or their access attempt will fail.
For added
 

Tags: ,

May 17 2011

Performing Administrative Tasks Using Central Administration (part 2)

Category: Sharepoint 2010Abhishek Shukla @ 08:55 | |
1.2. Using the Web Application Ribbon

In SharePoint 2010, you manage Web applications by going to the Web Application page and using the Web Application Ribbon, as shown in Figure 2. The sections that follow will show how to create, delete, and configure Web applications using the options you can select on this Ribbon.

" src="/CuteSoft_Client/CuteEditor/Images/anchor.gif">Figure 2. Web Application Management page


1.3. Creating a Web Application

To create a new Web application, select the New option on the left side of the Ribbon. This opens the Create New Web Application page shown in Figure 3.

" src="/CuteSoft_Client/CuteEditor/Images/anchor.gif">Figure 3. Create New Web Application page, Authentication and IIS Web Site sections


The first thing you must do when creating a new Web application is to select the authentication method. SharePoint 2010 introduces a new type of authentication called claims-based authentication, which can be used instead of the classic-mode authentication that is used in earlier versions of SharePoint.

The claims-based authentication model for SharePoint 2010 is built on the Windows Identity Foundation (WIF). Claims-based authentication in SharePoint 2010 enables authentication across Windows-based systems and systems that are not Windows-based by supporting delegation of user identity between applications. Using claims-based authentication, you can implement multiple forms of authentication on a single zone.

The other authentication option available on the Create New Web Application page, classic-mode authentication, refers to the Integrated Windows authentication model supported in previous versions of SharePoint, such as Windows SharePoint Services 3.0. In classic-mode authentication, no claims augmentation is performed, and there is no support provided for the new claims authentication features. Using classic-mode authentication allows you to implement all of the previously supported forms of authentication with a limit of one form of authentication for each zone.

 

When you create a Web application, it will automatically be allocated a random port number, a description field, and a folder location in the default local path. The default path is C:\Inetpub\wwwroot\wss\VirtualDirectories\portnumber. The application is not, by default, assigned a host header name. Therefore, you must specify in the Host Header text box on the Create New Web Application page shown in Figure 6-14 if you want to use a fully qualified domain name such as http://portal.contoso.com to access your Web application. You must ensure that this host header URL can be resolved by your users. Normally, this would be achieved by adding an entry into DNS pointing the URL to the Web server.


Note:

Name your Web application descriptions and paths with a consistent logical naming convention to identify them easily in the folder structure and in IIS. For example, instead of using SharePoint (9845) as the description, use Corporate Portal (9845) and specify the same name for the path and the host header. In addition, name your databases the same way that you name your Web application names so that you have naming consistency across your implementation. In this example, you could name the first database Corporate_Portal_9845_1, then name the second database Corporate_Portal_9845_2, and so forth. You should also name the folder for the Web application files with the same name. Scroll to the end of the path name in the Path text box (refer to Figure 6-14) and replace the default name of the folder with the Web application name.


Scrolling down the Create New Web Application page displays the Security Configurations section as shown in Figure 4.

Figure 4. Creating New Web Application page, Security Configuration and Public URL sections


There are two authentication providers available for a Web application—Kerberos and NTLM. Web applications use these security mechanisms when they communicate with other servers and applications in the network, such as when they communicate with the Microsoft SQL server hosting the databases. By default, the authentication provider is set to NTLM for maximum compatibility with mixed domain models and user account permissions. Figure 6-15 shows the Security Configuration section on the Create New Web Application page. Web applications use these security mechanisms when they communicate with other servers and applications in the network, such as when they communicate with the Microsoft SQL server hosting the databases.

Kerberos is more secure than NTLM, but it requires a service principal name (SPN) for the domain account that SharePoint is using. This SPN must be added by a member of the domain administrators group, and it enables the SharePoint account to use Kerberos authentication.

 

When you choose NTLM, it does not matter what your domain account is, because the application pool will run as long as it has the required permissions to access the SQL server and the Web server. The required SQL permissions for a Web application account are as follows.

  • Database Creator Role

  • Security Administrator

Anonymous access can also be enabled on a Web application, which would enable users to gain access to the sites hosted on the Web application without authenticating. If you choose to do this, however, you also must enable anonymous access on the site itself—enabling it on the Web application only gets the users past IIS authentication. Enabling anonymous access is a useful configuration for any Internet-facing sites, such as a company website.

security, you could also enable SSL certificates on the Web application. You can choose to use certificates from both your internal certificate authority and from an authorized certificate authority such as Verisign. However, you must install the SSL certificate on all servers where users are accessing your Web application or their access attempt will fail.
For added
 

Tags: ,

May 17 2011

Performing Administrative Tasks Using Central Administration (part 2)

Category: Sharepoint 2010Abhishek Shukla @ 08:55 | |
1.2. Using the Web Application Ribbon

In SharePoint 2010, you manage Web applications by going to the Web Application page and using the Web Application Ribbon, as shown in Figure 2. The sections that follow will show how to create, delete, and configure Web applications using the options you can select on this Ribbon.

Figure 2. Web Application Management page


1.3. Creating a Web Application

To create a new Web application, select the New option on the left side of the Ribbon. This opens the Create New Web Application page shown in Figure 3.

Figure 3. Create New Web Application page, Authentication and IIS Web Site sections


The first thing you must do when creating a new Web application is to select the authentication method. SharePoint 2010 introduces a new type of authentication called claims-based authentication, which can be used instead of the classic-mode authentication that is used in earlier versions of SharePoint.

The claims-based authentication model for SharePoint 2010 is built on the Windows Identity Foundation (WIF). Claims-based authentication in SharePoint 2010 enables authentication across Windows-based systems and systems that are not Windows-based by supporting delegation of user identity between applications. Using claims-based authentication, you can implement multiple forms of authentication on a single zone.

The other authentication option available on the Create New Web Application page, classic-mode authentication, refers to the Integrated Windows authentication model supported in previous versions of SharePoint, such as Windows SharePoint Services 3.0. In classic-mode authentication, no claims augmentation is performed, and there is no support provided for the new claims authentication features. Using classic-mode authentication allows you to implement all of the previously supported forms of authentication with a limit of one form of authentication for each zone.

 

When you create a Web application, it will automatically be allocated a random port number, a description field, and a folder location in the default local path. The default path is C:\Inetpub\wwwroot\wss\VirtualDirectories\portnumber. The application is not, by default, assigned a host header name. Therefore, you must specify in the Host Header text box on the Create New Web Application page shown in Figure 6-14 if you want to use a fully qualified domain name such as http://portal.contoso.com to access your Web application. You must ensure that this host header URL can be resolved by your users. Normally, this would be achieved by adding an entry into DNS pointing the URL to the Web server.


Note:

Name your Web application descriptions and paths with a consistent logical naming convention to identify them easily in the folder structure and in IIS. For example, instead of using SharePoint (9845) as the description, use Corporate Portal (9845) and specify the same name for the path and the host header. In addition, name your databases the same way that you name your Web application names so that you have naming consistency across your implementation. In this example, you could name the first database Corporate_Portal_9845_1, then name the second database Corporate_Portal_9845_2, and so forth. You should also name the folder for the Web application files with the same name. Scroll to the end of the path name in the Path text box (refer to Figure 6-14) and replace the default name of the folder with the Web application name.


Scrolling down the Create New Web Application page displays the Security Configurations section as shown in Figure 4.

Figure 4. Creating New Web Application page, Security Configuration and Public URL sections


There are two authentication providers available for a Web application—Kerberos and NTLM. Web applications use these security mechanisms when they communicate with other servers and applications in the network, such as when they communicate with the Microsoft SQL server hosting the databases. By default, the authentication provider is set to NTLM for maximum compatibility with mixed domain models and user account permissions. Figure 6-15 shows the Security Configuration section on the Create New Web Application page. Web applications use these security mechanisms when they communicate with other servers and applications in the network, such as when they communicate with the Microsoft SQL server hosting the databases.

Kerberos is more secure than NTLM, but it requires a service principal name (SPN) for the domain account that SharePoint is using. This SPN must be added by a member of the domain administrators group, and it enables the SharePoint account to use Kerberos authentication.

 

When you choose NTLM, it does not matter what your domain account is, because the application pool will run as long as it has the required permissions to access the SQL server and the Web server. The required SQL permissions for a Web application account are as follows.

  • Database Creator Role

  • Security Administrator

Anonymous access can also be enabled on a Web application, which would enable users to gain access to the sites hosted on the Web application without authenticating. If you choose to do this, however, you also must enable anonymous access on the site itself—enabling it on the Web application only gets the users past IIS authentication. Enabling anonymous access is a useful configuration for any Internet-facing sites, such as a company website.

security, you could also enable SSL certificates on the Web application. You can choose to use certificates from both your internal certificate authority and from an authorized certificate authority such as Verisign. However, you must install the SSL certificate on all servers where users are accessing your Web application or their access attempt will fail.
For added
 

Tags: ,