Make the workspace field visible in an existing SharePoint 2013 calendar

In a previous post I explained how to enable meeting workspaces in SharePoint 2013. The solution also includes a calendar list template with the meeting workspace field visible. You can use this template to create new calendar lists and use meeting workspaces there.

But what if you want to use meeting workspaces on an existing calendar created from the SharePoint 2013 standard calendar template or a calendar that has been migrated from SharePoint 2010. It’s quite easy using the SharePoint Management Shell.

Replace the yoursite URL and the name of your calendar.

$web = Get-SPWeb http://yoursite
$list = $web.Lists["Calendar"]
$myAss = [Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint");
$type = $myAss.GetType("Microsoft.SharePoint.SPField");
[System.Reflection.BindingFlags]$flags = [System.Reflection.BindingFlags]::Instance -bor [System.Reflection.BindingFlags]::NonPublic
$SetFieldBoolValue = $type.GetMethod("SetFieldBoolValue",$flags)
$field = $list.Fields.GetFieldByInternalName("WorkspaceLink")
$arr = @()
$arr+="Sealed"
$arr+=$false 
$SetFieldBoolValue.Invoke($field, $arr);
$arr = @()
$arr+="Hidden"
$arr+=$false 
$SetFieldBoolValue.Invoke($field, $arr);
$method = $type.GetMethod("UpdateCore", $flags);
$method.Invoke($field, $true);
$field.ShowInEditForm = $true
$field.ShowInViewForms = $true
$field.Update()
$web = Get-SPWeb http://yoursite
$list = $web.Lists["Calendar"]
$myAss = [Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint");
$type = $myAss.GetType("Microsoft.SharePoint.SPField");
[System.Reflection.BindingFlags]$flags = [System.Reflection.BindingFlags]::Instance -bor [System.Reflection.BindingFlags]::NonPublic
$SetFieldBoolValue = $type.GetMethod("SetFieldBoolValue",$flags)
$field = $list.Fields.GetFieldByInternalName("WorkspaceLink")
$arr = @()
$arr+="Sealed"
$arr+=$false 
$SetFieldBoolValue.Invoke($field, $arr);
$arr = @()
$arr+="Hidden"
$arr+=$false 
$SetFieldBoolValue.Invoke($field, $arr);
$method = $type.GetMethod("UpdateCore", $flags);
$method.Invoke($field, $true);
$field.ShowInEditForm = $true
$field.ShowInViewForms = $true
$field.Update()

Get the source code and the solution package that brings back the meeting workspace template on codeplex.

You can also use this script if you are using our Calendar E-Mail Extension to invite attendees to an event in a SharePoint calendar and the workspace field is hidden there too. This is the case if you enhanced an existing calendar by adding the “Event (with email extension)” content type.