SharePoint 2010 SP1 Not Installed

The past few weeks I have been working n scripting out the installation and configuration of SharePoint 2010 and all the services for a multi-server environment. I’ll be posting the details of the script in the coming weeks (okay most likely months….)

For the installation I have been using a slip-streamed set of media which includes SP1 and the June 2012 Cumulative Update. I farm will be using a SQL 2012 database which also provides the advantage of using the new BI features such as PowerView and SSRS as an actual service to SharePoint.

Everything seemed fine until I tried to configure PowerPivot and received a message saying “SharePoint 2010 SP1 is not installed on this machine.” This seemed odd as I’ve been able to configure everything up to this point….

After a few days of googling I finally got the correct search terms, which was “powerpivot error SharePoint 2010 SP1 is not installed”. This led me to a post by Jeff Jones blogger of www.spjeff.com. He has a create article which solved my problem called “Fixed -SharePoint 2010 SP1 is not installed on this computer.

The basic issue is that a registry key does not get updated with the new build version, causing PowerPivot to think everything is out dated. The registry key in question is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\BuildVersion.

Since I like scripts here is a little PowerShell goodness to help you out. Be sure that the Microsoft.SharePoint.PowerShell snap-in has been loaded into your PowerShell session before running.

$currentKey = Get-ItemProperty "hklm:\software\microsoft\office server\14.0\" -Name BuildVersion
$farmBuild = (Get-SPFarm).BuildVersion
Write-Host "Registry Build is $($currentKey.BuildVersion)"
Write-Host "Farm Build is $farmBuild"
if($currentKey.BuildVersion -ne $farmBuild)
{
Write-Host " - Updating registry build to $farmBuild"
Set-ItemProperty "hklm:\software\microsoft\office server\14.0\" -Name BuildVersion -value $farmBuild
}

Advertisements

SharePoint Modal Dialogs

SharePoint 2010 finally provided a way out of the horrible page refresh and post backs of SharePoint 2007 when it comes to viewing, editing, and adding items to libraries and list in the form of wonderful JavaScript modal dialogs.

What is even more awesome is that the even provided a way to make it optional for us. Why would would you want to provide full page navigation to these forms? The most common reason is if you have a complex custom form with a lot of fields or data, the full screen version provides benefit to the user, in limiting the amount of required scrolling they may need to do. Also, a concern is for accessibility issues where a screen reader may not detect the modal causing your user to miss out on there details they were hoping to consume.

Turn Off From GUI
To turn off the Modal Dialog from the GUI, the web browser is simple enough.

  1. Navigate to the list. From the List Tools of the Ribbon click List –> List Settings.
    image
  2. This will bring up the List Settings page. From here under General Settings  click Advanced settings.
    image
  3. You will then see the Advance Settings screen. Scroll to the bottom and you will find a row titled "Dialogs" with a radio buttons for Yes and No.
    As the description describes this turns the modal dialogs on and off.
    Yes being display as modals, and No being display as a page.
    image
  4. Click OK and the setting will take effect. Simple once you know where to look.

Turn Off via Object Model
Sometimes there is a need to set the Dialog value via code in the object model. There does exist a property on an SPList object called "NavigateForFormsPages" which controls this setting. As with many other SharePoint object properties the name does not always describe the related purpose.

"NavigateForFormsPages" is a boolean value where
True causes the forms to render as a full page, post back and all. While False, indicates that form rendering should be in the modal dialog. As with any list property settings don’t forget to call SPList.Update() after setting the value.

Here is some sample code of how to set the NavigateForFormsPages value from a Web scoped feature receiver:

public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
    using (SPWeb web = (SPWeb)properties.Feature.Parent)
    {
        web.AllowUnsafeUpdates = true;
        SPList newList = web.Lists["CourseDirectory"];
        if (newList != null)
        {
            //True - full page rendering
            //False - modal dialog rendering.
            newList.NavigateForFormsPages = true; 
            newList.Update();
        }
    }
}

See http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.navigateforformspages.aspx on MSDN for the super technical details regarding this list property.

Modal Dialogs and Custom Forms

You’ve written a super sweet custom application page for your content type, and am ready to set it free in your environment. Turns out during the stage testing (you do have a stage server right?) you custom form doesn’t actually close the modal dialog it resides in. Instead the modal dialog opens the redirect link in the current dialog. Possibly your close event code looks something like the following:

protected void btnExit_OnClick(object sender, EventArgs e)
{
    if (Request.QueryString["Source"] != null)
        Response.Redirect(Request.QueryString["Source"], true);
    else
        Response.Redirect(SPContext.Current.List.DefaultViewUrl, true);
}

You might see the following strange behavior where you modal never actually closes.

First, we open our item in the custom form, and see

image

After clicking CLOSE button which has the above custom code we get this:

image

Since our current context is still the frame set of the modal dialog our supposed closing just loads the code into the current window frame. Luckily,  with a little code and checking the current HTTP context we can close the modal or redirect if modal is turned off. Our new close event code would be this:

protected void btnExit_OnClick(object sender, EventArgs e)
{
    HttpContext context = HttpContext.Current;
    if (HttpContext.Current.Request.QueryString["IsDlg"] != null)
    {
        context.Response.Write("<script type=text/javascript>     window.frameElement.commitPopup();</script>");
        context.Response.Flush();
        context.Response.End();
    }
    else if (Request.QueryString["Source"] != null)
        Response.Redirect(Request.QueryString["Source"], true);
    else
        Response.Redirect(SPContext.Current.List.DefaultViewUrl, true);
}

Now, the following will happen:

image

And after close, a view of the All Items page of our list:

image

Now you have the know how to take advantage of the new modal dialog feature of SharePoint 2010.

The Mid Week Microsoft Fix

It is a Wednesday, though late morning I felt it was important to get out the latest collection of links for your reading and listening pleasure. It is always nice to have something new to review during that sluggish Wednesday afternoon. The Microsoft Broadcaster was lacking this week in anything exciting so here are a few links to some articles and blogs which I have found insightful.

Application Lifesycle Management in Microsoft SharePoint 2010

This is a link to a super intense, but very helpful article posted to the Microsoft SharePoint Developer Documentation Team Blog explaining the different approaches and steps to developing for SharePoint 2010. In this article, they explain the different setup options for development, QA/Testing, and deployment. They even explain how SharePoint Designer fits into the application lifecycle and code tracking. The second half of the article gives a detailed explanation of how feature version and solution version can allow for different upgrade and deployment management in a farm. This is a must read for any shop looking to get involved with performing SharePoint customizations. If you read only one thing this week this should be it!

SharePoint in Pictures

I like diagrams and pictures a lot, hence why my How-Tos contain a lot of them. I find it is the fastest way to understand a new complex concept or understand what needs to happen during a step. For this reason I have found the newest Microsoft SharePoint blog, SharePoint in Pictures, fascinating. Every couple of weeks the post a series of diagrams explaining some aspect of SharePoint 2010. These diagrams have been very helpful to me in explaining different SharePoint concept to users.

Tech Ed Europe 2010 SharePoint Videos

I wasn’t at Tech Ed Europe this year, but no fear, a number of the talks have been video d and posted for viewing. This is a link to all of the videos that were associated with Office and SharePoint.

Mid Week Microsoft Fix

Wednesday is here already, which only means one thing can be true. You are reading through the Mid-Week Microsoft fix.

With that mini intro, I’ll let you get to the goods.

Communities in SharePoint Server 2010: How Do I: Using Social Capabilities in SharePoint 2010 (Part 1)

This module concentrates on communities in SharePoint 2010. There are numerous great improvements and enhancements available to utilize in deployments. Understand the new social feedback, social network, user participation, and people and expertise…

Collection 10276: Microsoft SharePoint 2010, Application Development

The courses in this collection teach existing ASP.NET developers how to develop solutions on the SharePoint 2010 development platform.

Deep Dive – Microsoft Virtualization Best Practices for SharePoint 2010

Virtualizing business-critical applications can deliver significant customer benefits, including cost savings, enhanced business continuity, and an agile and efficient management solution. In this webcast, we discuss virtualizing Microsoft SharePoint 2010.

Your Mid-Week Microsoft Fix

Sorry to all those who look forward to some lunch time reading each week. Last week, was just one of those weeks were anything you wanted to do just kept getting shuffled further down the queue. In the process of compiling this weeks links, I decided for a name change to “Your Mid-Week Microsoft Fix”. I hope you like the name change, I’m not sold on it yet, so if you have any suggestions leave them in the comments..

So without any further ado…here is this week’s Mid-Week Microsoft Fix.

Security in SharePoint 2010: How Do I: Use the New SharePoint 2010 Security Model (Part 1)

This module concentrates on the security aspects in SharePoint 2010. We’ll concentrate on securing the deployment and also to new claims based authentication option. Learn about the new claims-based identity model available in SharePoint 2010. Presented


How Do I: Create a Business Data Connectivity Model for SharePoint 2010 Using Visual Studio 2010?

Microsoft Visual Studio 2010 provides a project type that enables developers to build Business Data Connectivity (BDC) Models that produce Microsoft .NET connectivity assemblies for Business Connectivity Services (BCS) in Microsoft SharePoint 2010.

TechNet Radio: Security with SharePoint 2010

In this session we spend time with Microsoft Certified Master and SharePoint Ranger Bryan Porter to discuss security with SharePoint 2010, its various implementations, and supporting technologies that help to ensure your data remains secure and protected

ASP.NET Security Patch

Last week I cross-posted, about a security flaw in ASP.NET which could allow an attacker to get access to files on the server.

Microsoft has announced an out-of-band patch for this on Tuesday, September 28, 2010.

Here is the blog post from the Microsoft SharePoint Team blog with details and links.

x-post from the Microsoft Security Response Center blog — The download links for the security updates are in the Security Bulletin.

As we announced yesterday, today we released Security Bulletin MS10-070 out-of-band to address a vulnerability in ASP.NET. The bulletin and the blog by Scott Guthrie, corporate vice president of Microsoft’s .NET Developer Platform are available for more information.

This security update addresses a vulnerability affecting all versions of the .NET Framework when used on Windows Server operating system. While desktop systems are listed as affected, consumers are not vulnerable unless they are running a web server from their computer.

The update will be made available initially only through the Microsoft Download Center and then released through Windows Update and Windows Server Update Services within the next few days. This allows customers the option to deploy it manually now without delaying for broader distribution.

For customers who use Automatic Updates, the update will be automatically applied once it is released broadly. Once the Security Update is applied, customers are protected against known attacks related to Security Advisory 2416728.

If you can, please join me and Dustin Childs today for a live webcast where we will cover the details of this bulletin and take customer questions live. Here is the registration information:

Date: Tuesday September 28, 2010
Time: 1:00 p.m. PDT
Click Here to Register

Thanks,
Dave Forstrom
Director, Trustworthy Computing

Big Security Hole for SharePoint Servers

You may have already read this somewhere out there, it is making the rounds across the Twitter-phere, blogs, and news. But I felt it would be important to post, or I should say re-post the issue.

Executive Summary from Vulnerability in ASP.NET Could Allow Information Disclosure (http://www.microsoft.com/technet/security/advisory/2416728.mspx)

Microsoft is investigating a new public report of a vulnerability in ASP.NET. An attacker who exploited this vulnerability could view data, such as the View State, which was encrypted by the target server, or read data from files on the target server, such as web.config. This would allow the attacker to tamper with the contents of the data. By sending back the altered contents to an affected server, the attacker could observe the error codes returned by the server. Microsoft is aware of limited, active attacks at this time. We are actively working with partners in our Microsoft Active Protections Program (MAPP) to provide information that they can use to provide broader protections to customers. Upon completion of this investigation, Microsoft will take the appropriate action to help protect our customers. This may include providing a security update through our monthly release process or providing an out-of-cycle security update, depending on customer needs.

Scott Guthrie has an excellent post up regarding this vulnerability at http://weblogs.asp.net/scottgu/archive/2010/09/18/important-asp-net-security-vulnerability.aspx. As normal, he has gone through with code snippets to explain the issue and what you can due to protect your systems.

Good luck keeping your systems safe!