SharePoint 2010: Setting custom User Profile properties Gotchas

What else do you need? Custom User Profile Properties (and several of the Out of Box ones) depend on a Managed Metadata Service Application being setup and associated with the application you’re working with. This is fairly trivial to setup. Just remember that after you set it up via the UI, you’ll need to start it on the “Manage services on this server” page, and then perform an IIS reset. Forgetting these will keep your Managed Metadata service from working.

Jon's General SharePoint 2010 Development Tips

In the time I’ve been doing SharePoint development, and SharePoint 2010 development in particular, I’ve tried to blog about the snags or neat stuff I’ve come across. This post is for all those little pieces of knowledge that come from working with the platform that don’t seem large enough for their own post. If you find it useful, let me know in the comments.

SharePoint 2010: The web application at ... could not be found. Verify that you have typed the URL correctly.

|- and so on with the error message. Do these also fit your situation? 1) The error happens when running a console application 2) Using PowerShell works to access the SPSite, SPWeb, or SPWebApplication that you’re accessing in your console application How do you fix this? Change your build platform target to x64 instead of x86. Also keep in mind that this is a per build configuration setting (so you have the setting for Debug and Release compile modes).

SharePoint 2010: Add a file to the root of your site using PowerShell

This can be useful when you need a file to be right off the root of your Internet facing site - files like robots.txt, sitemap.xml, or the verification file for Google Webmaster tools. We’ll take advantage of PowerShell’s ability to use any .NET methods along with the Files collection on each SPWeb in SharePoint. $fileBytes = []::ReadAllBytes("c:\the\full\path\to\your\file.txt"); $site = Get-SPSite "http://yourdomain:portifneeded"; $site.RootWeb.Files.Add("file.txt", $fileBytes, $true); This will result in a file.txt located at “http://yourdomain:portifneeded/file.

SharePoint 2010: Finding the largest document library in a site collection

SharePoint 2007 came with a page (storman.aspx) dedicated to showing you how much space each of the lists in your site collection were taking up. SharePoint 2010 removed this page. Luckily, SharePoint 2010 SP1 added it back in. But what if you’re still haven’t updated to SP1 and you’re getting warnings/errors about running out of space? Obviously - up the space so as to avoid additional noise from your users. Then - figure out which libraries are taking up the most space.

SharePoint 2010: Unable to delete site/web after SP1

While doing some testing after upgrading my dev machine to SP1, I ran into two separate issues when trying to delete a web through the UI by using the “Sites and Workspaces” link in Site Settings. Deleting through powershell worked fine.


SharePoint 2010: Disable Feature on all Web Applications PowerShell

Because it’s easier to copy+paste this later… This will disable a feature on all web applications in a farm. Very convenient for when you’re removing a feature from a solution. Get-SPWebApplication | ForEach-Object {Disable-SPFeature "Solution.Name.FeatureName" -url $_.Url;}

SharePoint 2010: Remove existing reusable content items using PowerShell

This same PowerShell could be used for any other list to remove all of the items. I just needed it to remove the OOB reusable content. $siteColTemp = Get-SPSite "http://yourSiteCollectionUrl"; $reusableContentList = $siteColTemp.RootWeb.Lists["Reusable Content"]; $reusableContentItems = $reusableContentList.Items; $reusableContentItemsCount = $reusableContentItems.Count; for($x=$reusableContentItemsCount-1;$x -ge 0; $x--){ $reusableContentItems[$x].Delete(); }

SharePoint 2010 SP1 Upgrade Error "Unable to create a Service Connection Point in the current Active Directory domain."

Full error: “Unable to create a Service Connection Point in the current Active Directory domain. Verify that the SharePoint container exists in the current domain and that you have rights to write to it.” After installing SP2010 SP1, PSConfig failed and the log had the above error. I found that the timer service was stopped and restarted it. Retried install - no error.

Time moves on. Google makes my extension irrelevant

|- And that’s a good thing! This morning while working to improve my extension for Google Calendar, I noticed that Google had added the ability to print multiple weeks or months straight from the Google Calendar. So where does that leave my extension? Well… unpublished and deleted at this point. I don’t see any reason to still make the extension available, maintain it, etc. if you can get the same or better experience straight from Google Calendar.