SharePoint Saturday Baltimore Slides

Posted by on May 15, 2012 at 11:36 am. No comments

I just got back from SharePoint Saturday Baltimore this past weekend, what a great crowd! Really awesome speakers and a really nice pool of folks from all over the area. Looking forward to doing it again next year!

This year I spoke about Driving User Adoption with Custom SharePoint Branding… one of my favorite topics. I co-presented with my awesome coworker Stacy Czerw and we got a pretty great response. I’ve uploaded my slide deck to SlideShare.net (full link here) and it is also available for download below.

Download the full slide deck presentation

If you attended my presentation, feel free to email me with questions! You can reach me at james@jornata.com – I’m always happy to help in the community.

Hide ‘My Site’ Link from Welcome User Dropdown Control

Posted by on May 11, 2012 at 4:32 pm. No comments

SharePoint 2010 adds lots of new, great social functionality. Right? True! However, it’s confusing and the end user wasn’t consulted. That’s ok, we can fix a lot of things using custom branding.

If you haven’t already noticed by my blog, branding in SP is one of my favorite things to do. I n another blog post coming soon I’ll post my session notes and materials from SharePoint Saturday Baltimore with source code you can check out.

So – one of the more confusing elements in SP2010 is the new My Site concept. Yes, it was around a bit in 2007 but they’ve changed the architecture in 2010. Don’t let the phrase “My Site” fool you, it actually refers to 3 things – when Microsoft says My Sites, they really mean:

  • User Profiles
  • User Personal Content Sites (your own site collection under the My Site host)
  • Your personalized homepage at the root of the My Site host

That last one is the more confusing of the 3. It’s not very obvious how you can customize the My Site homepage layout. Why? Well, that’s a whole other conversation all together. In short a user can customize the My Site homepage and make it their “launch pad” for the application:

customizemysite

Super not obvious, right? In fact this causes so much confusion for most of my enterprise level clients that we usually hide it all together! To do this, you can use an awesome CSS trick I learned from Anatoly Mironov:

Hide My Site link from user welcome menu

.ms-MenuUIUL li { display: none;}

Hide My Profile link from user welcome menu

.ms-MenuUIUL li { display: none;}

Of course you could also just disable this functionality from the User Profile Service Application permissions in Central Admin, but then you couldn’t use them at all. Sometimes you want these functions, just want to present them differently to the user.

Sometimes I even go another step further and add in a customized welcome.ascx to the page, start by copying the out of the box, create CustomWelcome.ascx and change the reference in your master page. Then you can add in your own links – like a custom ‘My Site’ link that actually takes you directly to your personal content site!

customwelcomecontrol

This is what most folks actually want… just link to /_layouts/MySite.aspx and you’ll go to your personal content site, or create one if you don’t already have one. You can also use /_layouts/UserDisp.aspx to go to the user’s User Profile.

Hide Page Elements from Print View

Posted by on May 2, 2012 at 10:12 am. No comments

On occasion I’ll have a client who needs to have printing functionality in their SharePoint portal. It’s fairly uncommon now – the whole point is to go digital, right? But it does happen. Most recently with a client in the bio-technology world, they were used to printing everything and just storing it in SP.

Calling the browser’s print function is the easy part:

Link to print current page:

<A HREF="javascript:window.print()">Click to Print This Page</A>

Display a button to print (which you can style of course:

<SCRIPT LANGUAGE="JavaScript"> if (window.print) { document.write(‘<form><input type=button name=print value="Print" onClick="window.print()"></form>’); } </script>

That’s the easy part. Now you’ll notice when you do this, there’s going to probably be a lot of things you see in your print out you don’t want to see. You have options! Simply call a neat CSS trick, the import function. This allows you to inject CSS based on your media type – print, mobile, web – so certain CSS styles only show in print view. This way you can do a nice {display:none;} on the elements you want to hide. For example, if I want to hide the title from print view, I would…

@media print
{

#s4-titlerow, #s4-statusbarcontainer, #s4-topheader2 { display:none; visibility: hidden; }

}

Neat trick, huh? Check out more info Display a button to print (which you can style of course:’ target=_blank>Display a button to print (which you can style of course:’ target=_blank>Display a button to print (which you can style of course:’ target=_blank>here, pretty good article.

Activate Feature for All Sites in a Web Application

Posted by on February 21, 2012 at 10:32 am. No comments

Recently I deployed a custom branding feature stapler for one of my customers migrating from 2007 to 2010. As part of the branding feature we had custom layouts and design on the My Site host and user personal sites. New personal content sites created automatically had some custom branding applied by swapping out master pages and adding some linked CSS style sheets to the Style Library.

The solution works great for new personal sites on creation, but migrated sites still had the old look and feel. I wrote the branding feature in a way that it is visible to users and can be activated on a site (sp-web). Since I’m not about to go activate the feature manually on litterally thousands of sites, I got a handy script to do it for me! Big thanks to my college Donal Conlon on this one, Principle Consultant and all around rock star at my company Jornata.

You first need to generate an xml file containing all the sites you want to work with. I’m sure there’s some PowerShell that would do the same thing but I already know this stsadm command will work.

stsadm -o enumsites -url http://mysitehosturl > mysites.xml

Once you have this XML file, feed it into this PowerShell scripts to activate your site feature. Note you’ll need to know the feature’s GUID in order to make it work.


## Enable feature on all sites in site collection
## This script takes the output from the stsadm -o enumsites command (xml)
## Run 'stsadm -o enumsites' first to generate the xml which lists all the site collections for the database

function ActivateFeature([string]$url){
 $featId = "7a8597ff-67a7-473e-b2f5-46d5b504643b"
 $feat = "BrandingTheme_MasterPageDeploymentFeature"

 $site = Get-SPSite $url
 $site | Get-SPWeb -limit all | ForEach-Object {
 if (!$_.Features[$feat]) {
 #Get-SPFeature -Identity $feat | Write-Host $_.Enabled
 try{
 Enable-SPFeature -Identity $feat -Url $_.Url
 }
 catch{
 Write-Host "Feature may already enabled"
 }
 }
 }
}

Write-Host "Getting sites xml file..."
1$config = Get-Content $args[0]
if($config -eq $null -or $err)
 {throw "unable to read xml file. Use stsadm.exe -o enumsites to generate xml"}

Write-Host "Number of site collections: " $config.Sites.Count
[System.Xml.XmlNodeList] $navElements = $config.SelectNodes("/Sites/Site")

foreach ($navElement in $navElements)
{
 $url = $navElement.GetAttribute("Url")
 Write-Host "Appling branding to $url"
 ActivateFeature $url
}

Download the PowerShell script in a .zip file here.

Alternatively you could use SharePoint Manager 2010 to activate the feature without needing to browse to the site. This is still a very manual process but a great tool as you can see hidden features as well which you can’t view in the UI.

Correct Installation Order for SharePoint Server 2010, Language Packs and Office Web Apps

Posted by on February 13, 2012 at 7:45 am. No comments

Here’s a great tip from SharePoint MCM Scott Jamison, Chief Architect and CEO at Jornata, around the correct order of installation for SharePoint Server, Language Packs and Office Web Apps. Yes, this stuff matters!

In order to properly install these items, you must do things in the following order:

  1. SharePoint 2010 RTM + SP1 (slipstreamed)
  2. Configure Farm using PowerShell
  3. Office Web Apps RTM + SP1 (slipstreamed)
  4. Run SharePoint Config Wizard (PSConfig) on all severs
  5. SharePoint 2010 Server Language Pack RTM + SP1 (slipstreamed)
  6. Run SharePoint Config Wizard (PSConfig) on all servers
  7. Install OCT 2011 CU (or current recommended CU)
  8. Run SharePoint Config Wizard (PSConfig) on all servers (if you get errors here, so additional note below)

Installing in any other order may cause issues and some functionality to not work properly.

Additional Note: Sometimes after installing CU’s I’ve noticed errors when trying to run the SharePoint Products Configuration Wizard (PSConfig), like in the screenshot below. In my case the PSConfig wizard was complaining about missing language packs and the CU files, which I could confirm had been installed properly and there before installing the CU. To fix this, I simply forced PSConfig through PowerShell – avoiding the GUI – and it worked like a charm!

psconfig.exe -cmd installcheck -noinstallcheck

You can find more info in a similar thread on TechNet. There's also IISRESET and rebooting your servers as potential fixes too.