Removing the "Use a Meeting Workspace" Option from All Existing and New SharePoint Calendars in a Site Collection

Having removed the "Use a Meeting Workspace" option from individual calendars in my previous post, I wondered if there was a way to remove them from all existing and new calendars within a site collection.

I found a way to do it by modifying the calendar schema in the hive folder. However, although this works, it technically leaves SharePoint in an unsupported state, so I didn’t want to go down that route.

Then I had a thought that all the items in a calendar list are of the Event content type, so if you can modify that, to make the Workspace option hidden, then it would be removed from all calendars.

Unfortunately when you look at the Event Content Type in the Site Content Types gallery, the Workspace column is greyed out so you can’t edit it.

eventContentType

However, it proved to be remarkably easy to script using PowerShell:

# Script to remove Use a Meeting Workspace from all calendars
$siteUrl = "http://myserver/sites/mysite"
[system.reflection.assembly]::LoadWithPartialName("Microsoft.Sharepoint") > $null
$site = New-Object Microsoft.SharePoint.SPSite($siteUrl)

$contentTypeId = [Microsoft.SharePoint.SPBuiltInContentTypeId]::Event
$eventContentType = $site.RootWeb.ContentTypes[$contentTypeId]

$fieldId = [Microsoft.SharePoint.SPBuiltInFieldId]::WorkspaceLink
$field = $eventContentType.FieldLinks[$fieldId]

$field.Hidden = $true
$eventContentType.Update($true);

# Dispose the site object
if ($site) {$site.Dispose()}

The only slightly tricky bit was needing to use the FieldLinks property instead of Fields.

The $eventContentType.Update($true); line ensures that it updates all existing calendars in the site collection, otherwise it will just be for new ones.

I’ve actually increased the script by 2 lines to fit it in my blog by adding in the $fieldId and $contentTypeId. Originally it was even more compact.

Again, this takes effect immediately throughout the entire site collection with no need for an iisreset or an application pool recycle.

Richard

I am Managing Director of SalamanderSoft Limited a company devoted to improving IT in education. I am also the project co-ordinator for the open source projects SharePoint Learning Kit and Microsoft Learning Gateway.

10 thoughts on “Removing the "Use a Meeting Workspace" Option from All Existing and New SharePoint Calendars in a Site Collection

  1. Awesome tip…thank you so much…this is terrific, and I haven’t noticed any side effects yet. Thanks again!

  2. Thanks for the script. I’m getting several errors trying to run it. The first error is ‘New-Object : Exception calling “.ctor” with “1” argument(s): “Invalid URl: The Authority/Host could not be parsed.” My $siteUrl is set to “http://myserver” because I want it to go through the entire sharepoint site. Is the problem because I’m running for the website’s root level, or does the script need to be run in a specific folder?

  3. Sorry, I left a slash off after the http. Great script. You can delete the previous comment.

  4. Thanks.
    this script has been proven very helpful to prevent creation of often unused workspace!

    Excellent!

  5. Great article!
    does this change apply to one site collection or the entire web applications in a farm?

    Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *