April 2012 - Posts

I survived another SharePoint Saturday in Houston this weekend and had a great time.  It was fun seeing old friends and making some new ones as well.  As promised, here is a link to my slide deck posted on SlideShare.  Thanks again to Victor and all of the volunteers and sponsors who made it possible.

New SharePoint Development features with Visual Studio 11

ULS Viewer works great for finding Correlation IDs but once you start dealing with large farms, I find PowerShell works much better.  A Correlation ID is great but it doesn’t do you any good if you can’t find it in the logs.  I put this script together through the help of posts from Wictor and others.  Using Get-SPLogEvent you can find pretty much anything you need in the logs, but without the right parameters it can run very slowly.  I’ve seen some scripts try to filter Get-SPLogEvent using a | but performs the filtering after it retrieves everything from the database.  The key to using Get-SPLogEvent is to use the –StartTime parameter.  You can obviously manually type in a date / time yourself but I find it much easier to calculate it with PowerShell.  To do this use Get-Date and then call the .NET DateTime method AddMinutes().  By limiting the scope to the last five minutes or so the call will execute much faster.  Here is what it looks like.

Get-SPLogEvent -StartTime (Get-Date).AddMinutes(-5)

You can then pipe the output and compare the Correlation with the –eq parameter:

Get-SPLogEvent -StartTime (Get-Date).AddMinutes(-5) | ?{$_.Correlation -eq $CorrelationId}

The value of $CorrelationId just comes in the command line with the following statement at the beginning of the script:

Param([string] $CorrelationId)

That gets us some results for the correlation id in question.but then you really want to format them.  We’re really only interested in the Category and Message fields from the logs.  You can optionally add the Timestamp field if you need the exact date / time.  We can format the results with Format-Table (or the ft alias).

Get-SPLogEvent -StartTime (Get-Date).AddMinutes(-5) | ?{$_.Correlation -eq $CorrelationId} | ft Category, Message –AutoSize

This format the results in a table but by default it constrains the width of the data to the size of your PowerShell window.  Often the details of that exception far exceed the default width.  To mitigate that, you can use the Out-String cmdlet and a –Width parameter.  I would go with a value of 1024 but you may need a higher value like 4096.  Experiment with it as necessary. 

Get-SPLogEvent -StartTime (Get-Date).AddMinutes(-5) | ?{$_.Correlation -eq $CorrelationId} | ft Category, Message -AutoSize | Out-String -Width 1024

At this point, any entry corresponding to the Correlation ID are displayed in the PowerShell window.  However, that’s not always very readable so I usually like to output the results to a text file.  For that, I just use the old Unix style > operator and specify a filename.  Here’s what the entire script looks like together.

Param([string] $CorrelationId)
Get-SPLogEvent -StartTime (Get-Date).AddMinutes(-5) | ?{$_.Correlation -eq $CorrelationId} | ft Category, Message -AutoSize | Out-String -Width 1024 > log.txt

Save your script in a file (i.e.: GetSPLogEvent.ps1).  You can then run it pretty easily with the following command.  Just pass a GUID to the –CorrelationId parameter.

.\GetSPLogEvent.ps1 -CorrelationId "a61775bd-a46f-4353-b62c-d4db3ec6cfea”

GetSPLogEventPowerShell

I then take a look at the output file log.txt to see the results:

GetSPLogEventResults

This is one of these cases where you can combine many different aspects of PowerShell to make your life easier.  Try out the script for yourself the next time you need to track down an error.

I am excited that it’s already time for SharePoint Saturday Houston again this Saturday on 4/28.  We already have more than 500+ people registered and it is sure to be a huge event.  I’m speaking about new SharePoint Development features in Visual Studio 11.  It’s a fun talk because it lets me pretend I am still a developer.  I did build a web part today so maybe I still am. :)  If you haven’t registered yet, you better do it fast.  I think there is already a waiting list.  Many thanks to Victor and all of the many sponsors, volunteers, and speakers that make this event possible.  I can’t wait to see everyone!

SharePoint Saturday is located at Norris Convention Center (803 Town and Country Boulevard, Houston, TX).

Also check out the Houston SharePoint Users Group.

with no comments
Filed under:

Recently, I became aware of this troublesome issue in regards to document previews with FAST Search for SharePoint.  It was on a new installation of SharePoint.  I had everything indexing great and my search results looked good.  However, after a while, I noticed that document previews were not appearing for our documents stored in SharePoint.  After further investigation and some discussion with some colleagues, we discovered that FS4SP had an issue with Claims Based Authentication as described in KB2641517.  The article describes the issue and makes it pretty clear what you have to do to make it work: switch back to classic authentication.  I wanted to go into a bit more detail about what is involved in that work-around though.

If you are familiar with claims at all, you may know that you can switch a web application from classic authentication to claims, but you may not switch back.  That means any work-around you pursue can be a bit involved.  Before, you start ripping your farm apart though, it is best that you understand where the issue with claims is.  In reality, it is not an issue with the web application that hosts your search center.  It can actually be running claims and document previews will work.  It’s the web application that hosts the documents themselves.  For example, if you have web application A running claims and web application B running classic, you will get document previews for the documents on web application B even if the search center was running on web application A.  The reason I point this out is so that you don’t just try throwing your search center on a classic authentication web application hoping that it will work.

That means if you want to get document preview working, you have to detach your content databases, delete the web applications, reattach the content databases, redeploy your solution packages and hope for the best. :)  It really shouldn’t be that big of a deal, but you should definitely plan ahead if you are going to make that kind of change.  From my understanding it has something to do with how the claims based application talks to Office Web Apps.  Office Web Apps works fine with claims based web applications when it comes to viewing / editing, so I don’t know why it’s an issue here.  I’ll let an expert on claims answer that.  Anyhow, I hope this insight helps should you run into this issue.

Recently, a client of mine acquired some KWizCom web parts.  I installed them and they seemed to work fine.  However, during the configuration, we ended up building a new web application or two.  On these web applications, I started to notice that we were receiving File not found errors whenever you went to AllItems.aspx on any list page (i.e.: Shared Documents, Web Part Gallery, Solution gallery, etc).  I immediately thought it was an issue with how I was applying custom branding but that turned out to not be the case.  Ultimately, I started seeing this issue on brand new web applications and site collections and I knew something had to be up.  Whenever I visited one of these pages that had the issue I got the following error.

File Not Found. 

FileNotFoundError

When this occurs you can view the Web Parts Maintenance Page but it is of no help obviously.  Ultimately, I queried the ULS log using Get-SPLog using tips I picked up from Wictor.  Be sure and use the –StartTime parameter to limit the scope of the query.  It will return something much faster.  Just paste your Correlation ID in the script and you are good to go.

Get-SPLogEvent -StartTime (Get-Date).AddMinutes(-5) | ?{$_.Correlation -eq "74adb0a7-655a-473b-9afa-5cc9edcc1aed"} | ft Category, Message –AutoSize

After the script executed, the culprit finally stood out.

kWizComFail

There from the snippet, you see mention of KWizCom.  Now it is all making sense. In this case, we had some of the web parts that do various things to lists.  As my first attempt at a solution, I redeployed all of the KWizCom solution packages.  That still didn’t help though.  I then tried activating all of the site collection features from KWizCom to see if that made a difference and that didn’t work either. Finally, I just retracted all of the solution packages and my lists started working again.  I haven’t yet redeployed the solution packages, but I suspect they should probably work, but it makes me leery.  This was killing brand new web applications.  When I try it again, I’ll update the post.

I am excited to say that I’ll be speaking at both TechEd North America and TechEd Europe.  This is my first time to even attend a TechEd so I am looking forward to see what is in store.  Both events are sure to be exciting but I am particularly excited to be going to Amsterdam for TechEd Europe since I haven’t been in 10+ years.  If you’re at either event, be sure and check out my session on Making the most of Search with SharePoint Online.  There you will learn some great tricks on how to get more out of your search experience in the cloud.  Links to my sessions are below.

TechEd North America

TechEd Europe

If you’re going to be at either event let me know.  I am looking forward to seeing old friends and meeting some new people.

Follow me on twitter: @coreyroth

As I have made my transition from an iPhone 4 to a Nokia Lumia 900 running Windows Phone 7, it has got me thinking about the state of the app market.  Keep in mind before you start hating, that I have carried an iOS device for the past four years so I feel like I can objectively compare these mobile app stores.  Not to mention the other iOS devices floating around here such as iPads (although I never actually paid for one).  No question iOS has more applications than any other mobile platform.  However, I venture to say that 90%+ (totally a subjective number) are total garbage or shouldn’t be an app to begin with.  We’ll break that apart.  According to Apple, they have over 500k apps.  What is not published is the number of apps that have a one star rating or have just been flat-out deleted from people’s devices.   Think about how many apps you have downloaded and then never used again.  How many apps do you have that you launch less than once?  I refer to these as single-use apps.  So sure, Apple has more apps than Android and Windows Phone but how many of those are nothing but fart applications? 

Let’s put quality aside though because Android and Windows Phone have their share of stupid apps that somehow people are making money on.  I introduce a new category of app that I refer to as the glorified web browser.  These are apps that really don’t bring you anything more than you could get by pointing your mobile browser to a web site.  What are examples?  Amazon, eBay, Yelp, USA Today, Facebook, YouTube, Google Search, Dictionary.com, Walgreens, IMDB, Southwest, United, Craig’s List, etc.  You get the idea.  Some of these apps might mix it up a bit and provide some unique features or push notifications, but in the scheme of things all of these apps do is render the same data you would get inside your browser.  Think about it.  Do you really need an app to interface with an E-commerce site?  All that is doing is taking up space on your phone.  It’s not that it taking up valuable space in memory either.  It’s screen real estate.  This is half the reason why Apple had to add folders to iOS so you had a place to hide away these seldom used applications.  I’m sure many of these apps have been successful, but I don’t think they are bringing a ton of value.  Most of them I can live without.  Facebook is an excellent example.  Those developers have such a mastery of HTML that the mobile web site almost looks like an application.  With so many apps that I really don’t need, I decided I could afford to make the switch to Windows Phone to pick up some of the features it provides that I really like.

So in my opinion, what makes a good app?  Here’s my list

  • Games
  • Audio streaming applications – i.e.: Pandora, iHeartRadio
  • Apps that make use of phone specific features
  • Books
  • Applications with Offline functionality – SharePoint Workspace Mobile
  • Communications apps – Skype, Lync
  • Apps that interface with devices – i.e.: Sonos, Pioneer Elite, Comcast, DIRECTV

I am sure there are other examples as well, but I think that’s a good list to start with.  Games is the most obvious one.  If you look at the top 100 apps, you’ll see no shortage of them.  Are there apps that I wish I had on my Windows Phone?  Of course, but there is nothing I am so dependent on that it’s a show stopper.  I know this may sounds like I am just trying to justify my Windows Phone purchase, but it makes sense to me.  Apple fans may not agree with me and that’s ok.  I having been one in the past know that there is no arguing with them.  :)

with 3 comment(s)
Filed under:

I’ve seen this conversation come up a few times.  Deploying code to SharePoint Online is not like deploying code to your test and production environments back on-premises. I thought I would give my thoughts on it and that will help you make a better decision.  Office 365 is not like Azure in the fact that you can simply spin up another web role for testing.  Nor do we have the ability to deploy code to one role and then swap it into production like we can with Azure either.  That means we have to get more creative.  Sure, you can develop code locally on a local SharePoint 2010 server and deploy it.  You can even use Visual Studio 11 to help you publish the solutions to the cloud faster.  However, this isn’t necessarily a good “test” environment since SharePoint 2010 and SharePoint Online have a lot of differences.

Effectively, the way I see it, we have two options for a test environment.

  • Create a new site collection
  • Create a new Office 365 account (tenant)

I know what you are thinking.  As a traditional developer building on-premises solutions, neither of these sound ideal.  Maybe they are not, but they actually make a lot of sense when we start thinking about it.  Let’s look at each option in detail.

New Site Collection

Now when this may not make sense for your on-premises farm solution.  It actually makes quite a bit of sense at the site collection level.  Think about it.  Our goal is providing a separate environment.  Well, pretty much everything you do with SharePoint Online operates within the sandbox of the site collection.  This includes solution packages which are published to the site collection’s solution gallery.  This makes it an ideal way to test customizations such as web parts, lists, content types, and more.  Simply create a new site collection, publish your customizations, test it out.  When you are done, you can even delete the site collection and create a new one when you need to test again.  Your code will not affect anything in the other site collections.

When will this not work?  When your code requires you to make changes at things at the tenant level.  For example, if you are testing some new term sets in the Managed Metadata Service or your solution is querying search.  If you were making use of the BCS, this might not be a good option either.  In essence, it works well for testing things like web parts and the use of the Client Object Model, but not so well for tenant based features.  For those features, it’s time to start looking at spinning up another Office 365 account.

New Office 365 account (tenant)

When you need to ensure that everything is absolutely separate in the cloud, the only way to do it is with another Office 365 account.  Go to try.office365.com and create a new account with a new prefix.  I’d recommend using a prefix that is easy to remember and indicates you are on the test environment.  For example, if your main domain is company.sharepoint.com, create something like companytest.sharepoint.com.  The benefit of creating a new account is that your service applications such as search, BCS, and the Managed Metadata service are truly separate.  You can also rest assure that nothing you do on this account, will affect your production account.

Probably the biggest drawback of this approach is that you have to maintain completely separate user accounts.  This can prove to be an inconvenience but it’s not terrible.  There may be some risk if you are testing permissions within your application, but you just have to deal with that.  Another drawback of this approach is that none of your data from your “production” SharePoint Online site will be present.  You’ll have to either manually upload it, deploy it with code, or look at a third party migration tool.

One other benefit of this approach is that you can just use a trial account.  Trial accounts are good for 30 days before you have to start paying.  This very well may be long enough to get you through your test cycle.  If your test cycle runs longer than that you can always just purchase a few licenses.  Keep in mind that Enterprise plans have a one-year term though.

Summary

These are the options I have came up with for testing customizations in the “cloud”.  I tend to go with just creating a new site collection, but I am sure I will find a change that warrants creating a completely separate account.  Have you come up with any other techniques for testing with SharePoint Online?  Post them here in the comments.

Follow me on twitter: @coreyroth.

It’s been a busy month for speaking (among other things).  Last month, I spoke about getting started with SharePoint Online development at SharePoint Saturday New Orleans.  The New Orleans crew (Cherie, Beth, and Tiffany) did a great job putting the event together.  Here are the slides that I referred to in that talk.

Office 365 – Introduction to SharePoint Online Development

Last week, I made the trip over to San Antonio to see Tom Resing (@resing) and the fine folks there.  There I presented to a full room of people looking to learn more about the new SharePoint development features in Visual Studio 11.  If you have been following my blog lately, you know I have been posting a lot about the new features lately.  As promised, here are the slides from that talk.

New Development Features in Visual Studio 11

For my next presentation, I’ll be speaking this week at the Houston Cloud Tech Symposium on 4/4.  This is a new event for me so I’m not sure what it will be like.  I’ll be talking about how you can use SharePoint Online for Extranets.  If you are in Houston this week and are attending the event, come see me.

Finally, I’ll be presenting my Visual Studio 11 talk at SharePoint Saturday Houston later this month on 4/28.  That event is always no less than epic so you need to be there.