Category Archives: Uncategorized

Sharepoint NCSS: Replace your content to save your sanity.

imagesThat’s right, SharePoint and The Shining. This is a combo that just works.

The insanity starts here …

NCSS solutions (No Code Sandbox Solutions, for the uninitiated) are extremely useful for laying in custom SharePoint groundwork. Via these solutions you can easily deploy custom Content Types, Site Columns, List Definitions, even Master Pages, Page Layouts, etc. I highly recommend using them. There’s no better way that I know of to deploy this stuff into SharePoint (and SharePoint Online, incidentally). I fully intend to blog more about these solutions in the future … including the good, the bad, and the unbearably ugly.

That being said, before I myself forget, allow me to impart upon you, the unsuspecting NCSS newbies, this one key piece of advice:

When developing your master pages, page layouts and auto-deployed pages in your modules, be sure to include the following element (in RED below): 

<File Url=mypage.aspx Path=default.aspx Type=GhostableInLibrary ReplaceContent=TRUE >

All failure and no success can make [your name here] a dull [boy|girl].

If you enjoy your sanity (or whatever semblance of sanity you claim to possess), you’ll add that key. Without it, changes you make in your NCSS  content will not be deployed, even if you deactivate your solution, upload a replacement, and re-activate the solution and the feature. The retraction of the feature/solution from SharePoint DOES NOT RETRACT THE CONTENT.

I personally was fighting deployment issues for well over a day trying to get one auto-deployed page to display properly. Incessant “file not found” errors were plaguing me. Turns out I had some invalid file references in the page layout, which as all of us light to moderately seasoned SharePoint devs know, means something doesn’t exist within SharePoint at the referenced location. (Dear Bill and team: If you could give us some indication as to what file is not found ON the page, that would be useful.)

Let this be a lesson to you. My hope is that you do not make the same mistake as I made.

Here’s to white puffy clouds, 70 degree afternoons and boat drinks in your future. Cheers.


SharePoint 2013: Sorry, this site hasn’t been shared with you.

HAL, I think you’re malfunctioning again … 

So here’s the setup: after a complete, stand-alone installation of SharePoint 2013 on a development VM and creation of a new site (let’s call it http://foocompellsyou:8080) via central admin, browsing the configured site returns this lovely message:

"Sorry [Dave], this site hasn't been shared with you."

SharePoint 2013 was installed and setup using the setup and configuration wizard. This had it’s own set of challenges, to be blogged about later.

I went through all of the normal checks post-creation of the new site:

  • Does the account I am logged in as have site administration access? Yes.
  • Are the app pools functioning? If not it would be a different message, but checking it can’t hurt.
  • Are the user policies configured correctly? Yes. In fact, the account I am logging in as has full control.
  • Can I get to http://foocompellsyou:8080/_layouts/settings.aspx? No. Same message.
  • Check the space weather index — anything out of the ordinary? No, it seems normal. For space.
  • What about the default authentication provider?

Ah … here’s something. A default install and creation of a new site will get you a claims-based application, but the default auth provider is set to Windows Auth/NTLM.

Changing this to Kerberos fixed the problem:Image

Hopefully this helps someone!



SharePoint 2013: Search Host Controller Service stuck in ‘starting’ state.

An odd issue came up recently where the Search Host Controller Service on a single web front end was stuck in the ‘starting’ state (as shown in the CA -> System Settings -> Services on Server). Couldn’t locate anything in the event log that showed why it didn’t start. And the final oddity: the service in Windows Services was started and running normally on all machines in the farm.

There are a bunch of posts out there (this one and others) that suggest un-provisioning and modifying registry settings and re-provisioning … oh myyyyy!

Before going down that path:

Start simple

When stuck in the starting state, there’s no ability via Central Admin to stop, start or restart. You might think rebooting your WFE might do the trick … no, think again. So the first step: enumerate the host services on your farm in powershell (note you will need to run as admin):

Get-SPServiceInstance | ? {$_.TypeName -eq "Search Host Controller Service"}

This will produce something similar to the following, though you will see differences based on the number of servers in your farm, and hopefully different GUIDs. If our GUIDs match … run for cover because the world is ending.

Server : SPServer Name=WFE1
HostControllerURL : net.tcp://WFE1/ceres/hostcontroller/nettcp
RepositoryVersion : 0
PrimaryHostController : True
SearchServiceInstanceId : 43d4837c-b0c6-42e1-93ff-c8b872854be7
Server : SPServer Name=WFE2
HostControllerURL : net.tcp://WFE2/ceres/hostcontroller/nettcp
RepositoryVersion : 0
PrimaryHostController : False
SearchServiceInstanceId : 6d02e4ab-bfb9-442f-8a29-705274ec8262
Server : SPServer Name=WFE3
HostControllerURL : net.tcp://WFE3/ceres/hostcontroller/nettcp
RepositoryVersion : 0
PrimaryHostController : False
SearchServiceInstanceId : 98d9cc05-92d6-4e2a-b872-3bd7d22f33a4

Super. I see services and one of them is dead. What’s next?

In this instance, it happens to be an issue on the 3rd server. I stopped and started it by running these two commands:

Stop-SPServiceInstance -Identity 98d9cc05-92d6-4e2a-b872-3bd7d22f33a4

And finally:

Start-SPServiceInstance -Identity 98d9cc05-92d6-4e2a-b872-3bd7d22f33a4

After refreshing CA -> Services on Server, the service was listed in the ‘started’ state.



Why did this happen?!?

No. Idea. If I had to make an semi-educated guess, it wasn’t really an issue other than it was displaying as “starting” in CA. The service was clearly running in windows services. Perhaps during startup the messaging got stuck. That being said, it looked very angry, and might have lead to false-positives when chasing down other issues on the farm.


Happy SharePointy-ing.

MSTR 9 + Win Svr 2012: A match made for hotfixin’

I recently spun up a MicroStrategy VM to be used as a demo/training box. In doing so it seemed natural to throw it on a Windows Server 2012. MicroStrategy 9 is shiny and new, Windows Server 2012 is shiny and new, what could possibly go wrong?

Well, I’m posting about it. There’s the first clue.

1st Issue: Configure IIS Properly

The first issue was that IIS was not fully configured for MSTR to run properly. The installation was complaining about missing IIS features. To head this off, configure 2012’s IIS as such:

1st page iis config

2nd page iis config

First time configuring the server I missed the following IIS components: “ASP” and “IIS Management Scripts and Tools”.

2nd Issue: She’s installed, captain, but she won’t start.

Yes, Scotty, we need more power. I get it.

After MSTR installation, several MSTR services will not start. You’ll see something like this in the event viewer:

The MicroStrategy Intelligence Server service depends on the following service: 
ProtectedStorage. This service might not be installed.

This service is no longer available Windows Server 2012 (or Windows 8).  See this post for some additional information. I guess Protected Storage is anything but.

Okay, that’s great. Now what?

The Fix:

There are a lot of posts on the inter-tubez describing several unsavory solutions, including running MSTR as an application, or hacking the registry, etc etc. You can skip all of that. MSTR HotFix #3 will take care of all of this for you. Simply install it, and you’re good to go.

One thing to note is that the hotfix #3 IS commutative. You can skip installation of hotfixes #1 and #2. Don’t believe me? Read the readme.

Now I’m  rockin’ a Windows Server 2012 VM with SQL 2012 and MSTR 9.3. Do you smell that new software smell? I do.


Windows Explorer and CMD

Here’s the setup: you’re browsing around in Windows Explorer, finding that command line tool or whatever. You find the correct location. Now you need to open up a command line. So you start/run/cmd, change drives if needed, and either copy/paste the folder path from Windows Explorer into CMD or manually navigate using a series of CDs and/or tabs.

Annoying, right?

A Trick

Here’s a trick I just learned today. I’m SURE this has been around forever, and is about as new as sliced bread. That being said, it’s a wonderful little shortcut and it deserves to be shared with everyone. It may only save a few seconds of real-time, but it saves a great many units of frustration-time. Here it is:

1) Find your location in Windows Explorer. In this case I’m browsing to the location of a NANT build script:


2) Put your cursor in the location bar, like so:

3) Type “cmd” and hit enter:


Boom. Nice, huh? There are a million different ways to skin this same cat, including installing power toys, scripts, shortcuts, etc. It’s nice, though, to utilize built-in shortcuts because they can be counted on across various Windows installations, specifically on production servers where you don’t necessarily want to install 3rd party tools or scripts.

Incidentally, this also works for “powershell”. And in both PS and CMD, there’s a way to reverse it. Type “explorer .” and Windows Explorer opens to your current PS/CMD location. My frustration level literally just went down a notch.

Earth shattering? Nope. Helpful? Duh.


The Curious Case of Chrome, Content-Disposition and the Comma.

Chrome just works. It’s generally cleaner, faster and it simply feels better than IE, FireFox and Safari. So when I heard a client tell me that something wasn’t working specifically in Chrome, I thought nah, that can’t be right!

Well, turns out the client was right. File downloading in Chrome was apparently not working! So what happened?

The Issue: 

The site I am working on has a Print to PDF feature that will convert certain content types within the site to a printer friendly HTML format using a special CSS. The results of this HTML are stuffed into a PDF using a 3rd party component, then the bits are shipped the  to the browser as a file attachment. This all occurs in a single runtime operation and is pretty standard stuff.

When the bytes are sent to the browser, to get the file to download automatically we’re setting the content disposition as such:

Content-Disposition: attachment; filename=[content title].pdf

The issue lies in the replacement of the file name. For sake of argument lets say the content type is a forum post, and we’re using the title of the post as the file name. Let’s also say the title of the forum post is “Foo, How it Compels You”.

The resulting content disposition header would be:

Content-Disposition: attachment; filename=Foo, How it Compels You.pdf

In Chrome, when the content hits the client side, literally nothing happens. Network traffic shows the request was made, and data comes back, however no download occurs. On closer inspection you may get this message:

Content-Disposition headers received

This is happening because Chrome implements a stricter version of the content disposition header. Chrome pukes on the comma and considers this a possible security risk. Not sure how a comma can compromise your security, but I’ve heard stranger things.

The Fix:

Knowing that it’s the comma causing the problem, the fix was obvious: replace the comma with a space. Done.

It’s also worth noting that as a precaution additional character parsing was implemented to replace invalid Windows file characters with spaces, then replace any double spaces with single spaces.  In hind sight this should have been in place from the start. But that’s hind sight for you.