• Service Pack 2 and the June Cumulative Update

    A follow-up from last week's post about the release of SP2 for Office and SharePoint 2010: The updates from the June Cumulative Update (KB 2855357) will not install on SP2. The August Cumulative Update will be the first to do so. However, the June Cumulative Update includes some changes that are not available in SP2. If you need those changes, and SP2 is already deployed, you will need to wait until the August Cumulative Update is released and install it to get the changes from June. If the updates from June are already deployed but SP2 is not, our recommendation is to wait until August is available and then install the updates from August and SP2 in any order.

  • Retrieve the list of Content Types in MOSS 2007 using PowerShell

     

    MOSS 2007

    [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") | out-null
    Write-host ".."
    Write-host ".."
    Write-host "Get a list of Content types"
    $site = new-object Microsoft.SharePoint.SPSite("http://spweb/extend"); # specify url here
    foreach ($web in $site.AllWebs) {
    $ctypes = $web.ContentTypes
    foreach ($ctype in $ctypes) {
    $usages = [Microsoft.Sharepoint.SPContentTypeUsage]::GetUsages($ctype)
    foreach ($usage in $usages) {
    Write-Host $web.Name + "," + $ctype.Name + "," + $usage.Url
    }
    }
    }

    SharePoint 2010
    $site = Get-SPSite("http://SPWeb/Site"); # Specify url here
    foreach ($web in $site.AllWebs) {
    $ctypes = $web.ContentTypes
    foreach ($ctype in $ctypes) {
    $usages = [Microsoft.Sharepoint.SPContentTypeUsage]::GetUsages($ctype)
    foreach ($usage in $usages) {
    Write-Host $web.Name + "," + $ctype.Name + "," + $usage.Url
    }
    }
    }

  • “The installation of this package failed” error while installing April 2013 CU (KB 2726992) for SharePoint 2013

    There have been issues reported where the installation of April 2013 CU for SharePoint 2013 fails with the following error:

    “The installation of this package failed”

    If you navigate to the temp file location (open windows explorer and type %tmp% in the address bar) and open the log file, “OPatchInstall(1).log”, located in %Userprofile%\AppData\Local\Temp\2 folder, you will see the following error:

    OPatchInstall: Getting the data from the file 'C:\temp\UBERSRV_1.CAB'
    OPatchInstall: Thrown CDetectionExceptionWin32(2)

    If you extract the contents from the executable ZIP file, you will see it contains two files; an exe and a cabinet file.

    j5ccjl4o

    If you only copy the ubersrv2013-kb2726992-fullfile-x64-glb.exe to a different location and try to install the CU, the operation will fail with the aforementioned error. The is because the CU is dependent on the 'ubersrv_1.cab' file and hence both the exe and the cab file need to be in the same location for the installation to complete successfully.

    To investigate and resolve update installation failures, see KB 954713

    Update

    The issue can also occur while installing June 2013 CU (KB 2817363) for SharePoint 2010.

  • SharePoint – Key Descriptions

    Also posted @ http://social.technet.microsoft.com/wiki/contents/articles/20023.sharepoint-key-descriptions-and-terminologies.aspx

    In this article, I plan to provide information about some of the basic components of SharePoint and the terms that we hear day-in and day-out. Please be advised that most of this information is scattered across multiple locations and I have only attempted to make this available here.

    Web Application

    A Web application is an IIS Web site that is created and used by SharePoint Products and Technologies. Each Web application is represented by a different Web site in IIS. Whenever a new Web application is created, a new content database will be created. By default (unless specified during creation) site collections created in the Web application will be placed in the Web application database.

    SITE

    Site = Web = SPWeb aka sub web

    A site is a collection of lists, libraries, and pages. Whenever you create a new site, a template for the site must be chosen. The templates available out of the box will differ depending on the SharePoint version that is installed. Sites are sometimes referred to as 'webs' also.

    • A site is a web is an SPWeb to developers, and a Sub web to old timers or subsite to those just trying to use something to distinguish it from a site collection.
    • STSADM - Site is a Web; 'Stsadm -o enumwebs' would enumerate a list of sites for a site collection.
    • In the Site Settings UI the site is most often referred to as a site, for example the ability to create sites and workspaces would be referring to sites within the site collection.
    • In the Central Admin UI it would be referred to as a web.
    • SPweb = to a developer they would iterate through a list of SPwebs for an SPsite.

    Site Collection

    Site Collection = SPSite = Portal = Sometimes referred to as a 'Top Level Site'

    A site collection is a set of Web sites that have the same owner and share administration settings. Each site collection contains a top-level Web site and can contain one or more subsites. In short, a site collection is a 'container' that holds sites or webs.

    • STSADM - Site 'Stsadm -o enumsites' would give you a list of site collections in a web application
    • Central Admin Site - Limiting the number of sites in a database is limiting the number of site collections per database
    • Developers - 'Site = SPSite' would be the equivalent. The SPsite would be the container and would have SPwebs on the inside.
    • Smallest unit for controlling storage database
    • Sites are backed up at the site collection level
    • By default, security is managed at the site collection level
    • Quotas can be configured for site collections
    • Sites are confined to share content within their own site collection
    • Level of ownership is defined at the site collection level 

    Page

    In the Office SharePoint Server, the actual "page" is a item a WSS list and the framework knows how to assemble these. This list has columns that are bound to three field controls (title, picture, article). Re-using SharePoint lists for data storage lets us build on existing and new WSS list features like content types, check-in/out, versioning, per item security, workflow and more. In edit mode, the field controls place constraints on the author for what content they can put in the "page".

    Master Pages

    Master pages in SharePoint work the same as they do in traditional ASP.NET applications. They allow designers to control almost all aspects of the overall layout of a SharePoint site. Master pages can be thought of as the glue that holds all of the SharePoint functionality together. In fact every SharePoint site will have a master page, whether it is custom or one of the out-of-the-box master pages. When a designer creates a custom master page, they are typically trying to make a SharePoint site look less like it does out of the box and more like a company’s specific brand.

    Master pages are stored in the master page gallery of a SharePoint site. They can be added to the master page gallery either directly from either SharePoint Designer or the SharePoint Web interface, or they can be deployed via a Feature.

    Master pages are applied to an Office SharePoint Server site via the Master Page settings menu located from the Site Settings of the SharePoint Web interface. One really nice thing about this menu is that it allows the administrator to apply a master page not only to the current site, but to all sub sites below it. Along with this manual method, master pages can also be applied to SharePoint sites via custom Features. Master pages can also be applied to Windows SharePoint Services sites. Like Office SharePoint Server sites, the master page is stored in the master page gallery. Unlike Office SharePoint Server, changing the master page can only be done through a custom solution.

    Themes

    SharePoint themes are different from ASP.NET themes; they are used specifically to change the colors, fonts, and some of the images that are used in SharePoint sites. Unlike master pages though, they cannot be used to move SharePoint elements or change the layout of the page. They are created entirely with CSS and images and cannot use any custom ASP.NET code.

    SharePoint themes are typically added by manually logging into the physical server and copying the various files (images, CSS, and XML) to several folders in the 12 directory. They are applied from the Site Settings menu in the SharePoint Web interface.

    For more information on creating SharePoint themes, refer to the following articles:

    Site Master Page vs. System Master Page

    By default the following rule applies:

    • Site Master Pages: Used by all publishing pages - and only by publishing pages
    • System Master Pages: Used by everything else including forms and view pages

    You cannot change the default behavior - but you can use SharePoint Designer to change the master page assignment for individual pages if required.

    If you open a page in SharePoint Designer you can see a Master Page File setting which can be modified:

    • "~masterurl/default.master": the page will use the system master page
    • "~masterurl/custom.master": the page will use the site master page

    Master Pages vs. Themes

    While both master pages and SharePoint themes can apply branding to a SharePoint site, they differ in a few key ways. The following table highlights these differences.

    Master-Pages

    Site Templates

    A site template is a file that dictates the overall look and feel of a site. It includes all of the design information about a site, such as:

    • The lists within a site.
    • Any Web Part Pages within a site.
    • Any custom pages within a site.
    • The theme or Master Pages applied to a site.
    • Any customizations to the Quick Launch.
    • Site content (list and document library contents — optional).

    Site templates do not include the following items:

    • Security settings, such as a list of users or groups with permissions to the site from which the template was created.
    • Personalizations to Web Part Pages.
    • Web discussions from the original site.
    • Alerts from the original site.
    • Web part assemblies that were added to the original site.


      Default site templates (MOSS 2007)  
      SharePoint Server 2010 site templates

    Content Types

    A content type is a reusable collection of settings you want to apply to a certain category of content. Content types enable you to manage the metadata and behaviors of a document or item type in a centralized, reusable way.

    A content type is an object that defines several elements of a piece of content, including:

    • Document Template that the content will be based on
    • Columns that the content will have associated with it (metadata)
    • Workflows that the content will use
    • Information Management policies that apply to the content
    • Conversion types for the content

    Additionally, content type can include the following information:

    • The metadata, or properties, you want to assign to this type. These are represented by columns added to the list or document library when you add the content type.
    • Custom New, Edit, and Display forms to use with this content type.
    • Workflows available for items of this content type. These can be defined to start automatically based on a selected event or condition, or through user selection.
    • For document content types, the document template on which to base documents of this type.
    • Any information necessary for custom solutions associated with this content type. You can store this information in the content type as one or more XML documents.

    Page Layouts

    Only available in Office SharePoint Server sites, page layouts provide yet another means for designers to style the content of a SharePoint site. While master pages provide a unified outer shell design for a SharePoint site, page layouts define the specific look and the editable data for various types of pages. They allow another level of granularity by allowing the same type of data to be shown in different ways, like an article page or a welcome page, while still utilizing the same master page. Page layouts are created in SharePoint Designer and are based on SharePoint content types and site columns. From an administrative standpoint they are added to Office SharePoint Server sites in a similar fashion to master pages. They are also stored in the Master Page Gallery and can, like master pages, can be added from SharePoint Designer, the SharePoint Web interface, or deployed via SharePoint Features.

    Page layouts help dictate the overall look and feel of a Web page. A page layout relies on a content type to determine the kind of content that can be stored on pages that use the page layout. Content for the page is stored in fields on the page. When you view or edit a page, the content is displayed in field controls. When you create a page layout, you add field controls using a Windows SharePoint Services-compatible Web authoring tool, such as Microsoft Office SharePoint Designer 2007.

    The types of fields on a page are determined by the content type for the page. Each content type contains columns that correspond to the fields on the page. When you create a content type, you add column templates to the content type for each field. Column templates determine the default field control that is associated with the columns as well as the kind of content the field can contain, such as a single line of text, a hyperlink, or a picture.

    Content types for page layouts are based on the Page content type and contain the columns for the fields that can be used on pages based on the page layout. The Page content type is a system content type template created by the Publishing Resources feature. The column templates from Page will be added to all Pages libraries created by the Publishing feature.

    By default, the Page content type contains a number of columns that page layouts require. The following table describes a sample of these default columns.

    Features and Solution Files (.wsp files)

    Features and Solutions are an important concept for administrators to understand. They can make the management and maintenance of a farm much easier when used together. Features provide the ability to define a piece of functionality that can be turned on and off at a given scope, such as the site collection, site, or Web application. Solutions provide the ability to package and install a feature much like a Windows .msi file, and have one installation and deployment point for all servers in the farm. The deployments can be scheduled and whenever new servers are added to the farm, the existing solutions are automatically deployed to the new server. Developing functionality as Features and deploying them as Solutions is the recommend deployment strategy for SharePoint customizations.

    For more information on the benefits of using solutions and features, refer to the following:

  • Intermittent "HTTP 403 – Forbidden" error while trying to browse to a SharePoint web app

    Consider a scenario where you receive the following error when you browse to a SharePoint web app

    The website declined to show this webpage
    HTTP 403 
    Most likely causes:
    This website requires you to log in.

    qxylgifx

    This issue is intermittent. Strangely, if we create a copy of the web.config file, rename the web.config file, refresh the home page, we receive an "HTTP 404 - Page Not Found" error. Rename the web.config file back and refresh the page. The site is browse able for a while before failing after some time

    We see the following error in Failed Request Tracing

    3wjk4xr5

    A procmon trace captured while accessing the web app from the server showed the following:

    w3wp.exe 4180 CreateFile C:\inetpub\wwwroot\wss\VirtualDirectories\Web80.Contoso.com80\bin ACCESS DENIED Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, Impersonating: NT AUTHORITY\IUSR

    5cgganli

    This issue usually occurs when a request from an authenticated user without local admin rights results in a failed read of the /BIN directory by the impersonating w3wp.exe (IIS worker process for ASP.NET) process. This behavior is typically associated with lack of permissions to the temporary folder /BIN where ASP.Net assemblies are Just In Time (JIT) compiled.

    Resolution

    The solution is to ensure that the Authenticated Users or <SERVER NAME>\Users group (which usually contains DOMAIN\Users group) has Read & Execute, List Folder Contents and Read permissions on the /BIN folder below C:\inetpub\wwwroot\wss\VirtualDirectories\{Sitename80}. Follow the steps listed below to grant the required permissions:

    • Open Windows Explorer and navigate to the /bin directory of your web application
    • Right-click on the folder and click on Properties
    • Go to Security tab and click on Edit
    • Click on Add and add the local server group Authenticated Users or <SERVER NAME>\Users (this usually contains DOMAIN\Users group).
    • Select the Read & Execute, List Folder Contents and Read permissions (if you are planning to add Everyone to the /bin folder, grant Read permissions only)
    • Click OK to apply the new settings

    Refresh the page and we should be able to browse to the site.

    There are instances where this permission needs to be re-applied as part of every deployment and we may often find that the permissions have reset after touching the Authentication Providers settings in Central Admin.

    More Information

    If an administrator accesses the site/feature that caused the error, the subsequent requests from non-administrators would succeed. This behavior is typically associated with lack of permissions to the temporary folder where ASP.Net assemblies are Just In Time compiled.

    The freb trace shows a 403.0 for ManagedPipelineHandler

    It seems to go through quite a few ASPNet events - but happens during the ASPNetPageRender - it goes to the ASPNetPageRender Enter, then ASPNetHTTPHandler Leave.Only then does it get a 403.0 which is not an official RFC error. The first sub-status for 403 is 403.0.

    Application pool in Classic or Integrated mode

    1. Application Pool in Classic Mode – In this case, we can configure a Wildcard mapping for ASPNET_ISAPI.dll at the website level. That would propagate to child virtual directories. That should not need any further modifications at the virtual directory level.
    2. Application Pool in Integrated Mode – In this case, all relevant virtual directories would need individual modifications. They need to be set for specific handler. E.g. ‘book’ virtual directory needs mapping for BookAPI and ‘movie’ directory would need mapping for MovieAPI.