Skip Ribbon Commands
Skip to main content

Tom Resing's SharePoint Blog

:

Tom Resing's Website > Tom Resing's SharePoint Blog
 

 Posts

 
April 27
Removing the Name ActiveX on 2010 the 2007 way

I got a new laptop for work last week and noticed that tomresing.com was asking readers to install that silly Name ActiveX control. Actually, I noticed sharepointrunner.com was showing it first and after Mark fixed his so quickly, I figured I better do the same.

Aside

You may be more familiar with my other new coworkers like Shane, Todd, John, Randy, Laura, Jennifer and Raymond. However, fanatical SharePoint Engineer Mark Watts, on the Rackspace Managed SharePoint team, has an excellent looking SharePoint blog hosted on SharePoint at Rackspace with almost 10 branding focused posts since the beginning of 2012.

KB OG

KB 932519 written for 2007, still applies if you don’t have access to the Central Admin method. However, the steps in the Microsoft Knowledge Base article still require access to the server if you follow them exactly. At my current host, I don’t, and a slight modification of the steps gets the desired results.

No Server Access Steps

Do: use the same script as the KB

function ProcessImn()
{
       if (typeof(ctx)=="undefined") return;
       if (ctx.CurrentUserId == -1) return;
       if (EnsureIMNControl() && IMNControlObj.PresenceEnabled)
       {
              imnElems=document.getElementsByName("imnmark");
              imnElemsCount=imnElems.length;
              ProcessImnMarkers();
       }
}

Do: Save the script to file named initNoPresence.js

Don’t: save it to the SharePoint Root, put it somewhere like the SiteAssets folder

Do: insert the following link in your v4.master just before the end head tag, </HEAD> :

<script type="text/javascript" src="/SiteAssets/initNoPresence.js"></script>

Done!

April 13
More SharePoint at Rackspace

More for me. More for them. More for you.

I’m joining the incredibly talented, infamously humorous, infinitely engaging SharePoint team at Rackspace.

Jeff Deverter and company have hosted the San Antonio SharePoint User Group monthly meetings at Rackspace for a couple years now and I’ve gotten to know a lot of their smart admins. With the recent addition of the SharePoint911 crew the level of SharePoint talent at Rackspace exploded overnight.

If you attend conferences that include SharePoint content, it’s hard not to run into the 6 MVPs formerly of SharePoint911, now Rackspace. I got Shane and Todd to pause during TechEd 2010 for a picture with me (above) where their SharePoint 2010 Administration book was the most popular of the show. Their book sold out all copies in the Microsoft Bookstore on the 1st day of the conference.

I’ll continue to do SharePoint consulting for Rackspace on Shane’s team. And I’ll most likely pursue the evolution of MCM called the MCSM. But one of the things I’m most excited about is the opportunity to do more community events, speaking and writing about SharePoint. Look for a new book from me when Wave 15 hits, a move of TomResing.com to the Rackspace Cloud and a SharePoint Saturday San Antonio announcement coming soon.

Read more about SharePoint + Rackspace

April 09
Service Application Reading

Healthy service applications are very important to a SharePoint 2010 Farm. When SharePoint 2010 was new, there was a lot of attention paid to them. The shift from the Shared Service Providers of SharePoint 2007 and earlier to the new model for 2010 was significant, both understanding the underlying concepts and the effects the shift had on the platform.

Whether you are just creating your first SharePoint 2010 Farm, maintaining an existing Farm or refreshing your server application chops, I found a good series of articles from the past that can help you get up to speed

A good collection of short articles from Spence

I’ve been a big fan of Spencer Harbar’s blog going back most of 7 years to the Microsoft Content Management Server days. After having attended the Microsoft Certified Master course where Spence teaches a lot, I’ve given it even more attention.

I recommend that anyone responsible for setting up a reliable SharePoint 2010 Farm read the following articles to get up to speed or review Service Application concepts. They are all short, but very good references.

· SharePoint Server 2010 Worker Processes

· More on SharePoint 2010 Application Pools

· In a Nutshell: SharePoint 2010 Service Applications

· SharePoint 2010: Service Applications Part One: Model Overview

February 17
Elevating Privileges in SharePoint Code

Impersonation leads to Permission Trimming

SharePoint uses ASP.Net impersonation to personalize the platform based on the current authorized user. SharePoint objects are aware of the user’s identity and many parts of SharePoint take advantage of this ability. For example, when you get the lists in a site through the API, you only see the ones the current user has access to. Permission trimming, as similar functions in SharePoint are often referred, is a major convenience to the end user and a feature of SharePoint that many rely on.

Experienced in ASP.Net but not Impersonation

For many developers coming from backgrounds in ASP.Net projects where impersonation is not used, this can be very confusing. For example, many developers new to SharePoint, including myself, were surprised the first time they realized that opening a connection to a database was denied because the connection was access as the end user, not the application pool account. The natural first reaction is “Who moved my cheese? How do I get back to normal?” Where normal is the previous normal of ASP.Net web applications not using impersonation. However, as MSDN cautions, running with impersonation is something you should get used to when using Sharepoint:

If you use Windows authentication and your code calls the SharePoint object model from an Internet Information Services (IIS) worker process, the request must impersonate the calling user’s identity. SharePoint Foundation configures ASP.NET to impersonate the calling user automatically, but your code may work unexpectedly, or fail, if you suspend impersonation

Quoted from <http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.aspx>

When to RunWithElevatedPrivileges, When not to

Often, failing to suspend impersonation in the way MSDN cautions about, the next step a developer will take to “solve the problem” of impersonation is to use a SharePoint API call named SPSecurity.RunWithElevatedPrivileges.

RunWithElevatedPrivileges is a great way to solve the database connection problem, but often it can become somewhat of a Pandora’s box. It can become a go-to tool for every permission error encountered in SharePoint code. However, there are some issues that can occur with overuse of this style of programming, not least of which is that you lose some core SharePoint functionality inherent with impersonating the user.

A StackOverflow discussion about the pitfalls of RunWithElevatedPrivilges is a good summary and starting point for reading on the subject. Also, I’ve included below 3 good references for further reading on the topic.

Further Elevated Privileges Reading

These first two links below are from Daniel Larson, co-author of Inside Microsoft Windows SharePoint Services 3.0 published by Microsoft Press. I consider that one of the best books written about SharePoint Development and I’ve read it cover to cover more than once. The first post is a set of good general guidelines. The second is a more concrete implementation of impersonating using the SPSite constructor. The third link is by a .Net Developer Keith Dalby who is a former Microsoft employee and MVP. I don't use his approach, but I think some .Net Developers who are fond of recent changes in the .Net language would appreciate his take.

  1. Best Practices for Elevated Privilege in SharePoint
    1. http://daniellarson.wordpress.com/2008/06/06/best-practices-for-elevated-privilege-in-sharepoint
  1. Elevated Privilege with SPSite
    1. http://daniellarson.wordpress.com/2008/06/13/elevated-privilege-with-spsite
  1. Elegant SPSite Elevation
    1. http://solutionizing.net/2009/01/06/elegant-spsite-elevation/
February 02
SharePoint Saturday Austin Slides
Thanks to all who attended my presentation at SharePoint Saturday Austin in January. As promised, here are the slides for your reference.

Picture

Here's a picture from the event by Victor:

The presentation

January 23
Cloudshare How-to 48-hour SharePoint Virtual Machines in the Cloud

I’ve blogged about SharePoint Development on Cloudshare in the past, see Some SharePoint Development Machine Options, but I thought I’d go through a screen-shot how-to so you can see how easy it is to get up and running with them.

First, browse the solution showcase, pictured below:

After choosing a pre-set environment of one to many vm’s, register for the trial account. I suggest trying the Microsoft Information Worker VM first because it has lots of great demos set up already.

After confirming you received their email to finish registration, your machines are already running in the cloud and ready for you to open in the remote desktop active X application direct from the browser.

 

Enjoy using Cloudshare for SharePoint Development and Testing. Let me know if this was helpful or needs work in the comments on http://www.tomresing.com

November 17
SharePoint for DBA’s Part II at SALSSA

Last night I presented SharePoint for DBA’s Part II to the San Antonio League of SQL Server Administrators.

Slides

The slides from the presentation are available for download and viewing on SlideShare.

Screencast of part of Demo 2

I recorded a screencast of one of the demos from the presentation.

Video Note: I recorded the video above because during the presentation I ran into an error which prevented the creation of the External List from the External Content Type and I wanted to show how the demo should have ended last night. More detail on the error I received and how to solve it is below.

No Finders Error Solution

While creating the external list I received the following error every time I tried to create the list. I also received various other errors which came from rushing trying to recover from this one I hadn’t seen before.

The error states “No Finders available in the View Group associated with the Specific Finder (Read Item) operation.”  That alone wasn’t enough information for me to figure out what was wrong with my Read Item operation at first glance.

A quick search turned up the solution on MSDN Forums. “Try making sure that the columns in your Read List and Read Item Operations are the same.” This indeed is the key and it’s easy to reproduce the error condition once you have this tip.

To generate the error screenshot above, I just removed one column from my Read Item Operation so it didn’t match the list of columns in my Read List Operation and attempted to create a new External List from the External Content Type. Simply adding the same column back restores us from the error condition.

Reference

November 08
SharePoint First Steps for Administrators and Developers

In late 2006, when I asked my mentor what I needed to do to get up to speed quickly on SharePoint for my first major SharePoint project, he had great advice that I only followed reluctantly. The mentor was Matthew McDermott. He told me to read more than 1000 pages of free documentation from Microsoft. And he told me to practice it and then re-read it and only then I would know the basics. At the time, it sounded crazy to me as an additional workload to my current projects. Only because I trusted Matt, believed in Microsoft’s new vision for the as of yet unreleased SharePoint 2007 at the time and wanted to deliver a quality first SharePoint project that I took his advice. And I couldn’t be happier that I made that leap.

Combined with the advice and mentorship of another great consultant, Tom Stewart, I was ready for learning what I needed to lead a project on this new platform. With Tom, I had already gained experience on Microsoft Content Management Server. I had become comfortable with the Content Management concept of page layouts and publishing pages that applied in SharePoint with the 2007 release. I also had worked on SharePoint web parts before. But I hadn’t really grasped the power of the platform before I set off to really understand how it is installed and configured. What follows is my advice for new SharePoint installers based on the advice I received when I was new. I’ve updated it to SharePoint 2010, but keep in mind there have already been multiple releases of the books below during the current product’s life and there may be more.

The Downloadable Books

There is so much Downloadable book content for SharePoint Server 2010 now compared to before. I noticed they even have many of the downloadable books for sale on Amazon now, which isn’t a bad option. I normally print some of the books out, but it is a lot of pages. It might cost as much in ink and paper as the cost to buy it preprinted and bound on Amazon.

The list of books, posters and white papers is on TechNet:

http://technet.microsoft.com/en-us/library/cc262788.aspx

Of those, I generally recommend reading the two planning guides cover to cover, about 800 pages and the deployment guide, another 380 pages.

Your First Install

For a first time install of SharePoint, I recommend printing out the deployment guide and following it step by step, making notes on the pages where you might make changes in a future installation. After installing and configuring SharePoint a few times using the deployment guide and after reading the planning guide, you should have a good grasp on most of the backend features of SharePoint. You might even be ready to pass a Microsoft Certification for IT Pros.

For Developers and Admins?

Whether your goal is to move more into the administrator or developer side of SharePoint, following the steps above is a good start. The IT Professional side of SharePoint deals with server installs, configuration and maintenance. The Developer side of SharePoint involves writing custom solutions that are deployed to a SharePoint Server. However, as a SharePoint Developer, you often are best served by installing and configuring your own development environment to mirror the production server. The better you grasp the concepts introduced in the above books, the better you will be able to control the fate of your development server.

November 03
SharePoint Weekly, Andrew Connell and MVVM

I just noticed on the SharePoint Weekly Newsletter from Nick Swan that Andrew Connell has a new blog series on SharePoint, Silverlight and MVVM. Developers love design patterns and just the thought of MVVM takes me back to my one of my favorite Computer Science classes on Java 15 years ago.

If you’re not familiar with Andrew, you should check out some of his stuff. He’s one of my favorite SharePoint Development Authors and Presenters and having shared a few pints with him, I can say he’s a nice guy. I’ve been reading his blog posts and books since the Microsoft Content Management Server days before SharePoint 2007 when he was one of about two reliable sources I found on the product. One of his latest books is Inside Microsoft SharePoint 2010 which I’ve only skimmed but this one he co-authored looks to be the premier SharePoint 2010 dev book from MS Press.

 

If you haven’t heard of SharePoint Weekly, check it out here: http://www.sharepointweekly.com/

November 01
FBA Claims Super User Halloween Gotcha

I’ve been working with Claims Authentication a lot recently and I’m still tripped up by some of the basics, it would appear. Yesterday, on Halloween, I received an access denied error on my web application after configuring it for Forms Based Authentication. I had previously migrated it to windows claims, but this was my first try moving an existing web application from windows claims to FBA Claims.

The error in the ULS was misleading:

Cannot get Role Manager with name aspnetsqlroleprovider. The role manager for this process was not properly configured. You must configure the role manager in the .config file for every SharePoint process.

After searching all my web.config files for the word aspnetsqlroleprovider I realized I was on a wild goose chase. The culprit was the “Claims Super User Settings” as I will phrase it. I’d dealt with it before when moving the same web application from windows integrated to window claims authentication, but thought I’d properly addressed it the second time around until I got this error.

If you receive an access denied after changing claims authentication settings, take a minute to re-read Configure object cache user accounts in the TechNet SharePoint 2010 Server Operations section. In the case of my FBA implementation, I tried the PowerShell method first, but still received the error afterwards. It wasn’t until I configured the User Policy as described in the reference above that resolved the error.

Claims References

1 - 10Next
 

 About this blog

 
About this blog
Tom is a Microsoft Certified Master in SharePoint 2007. I write an average of 2 posts a month on topics I have interest and experience on.