Category Archives: Administration and Configuration

The Future of InfoPath Forms

Posted by on February 2, 2014 at 6:19 pm.

It’s been a long time speculation Microsoft would be phasing out InfoPath support in SharePoint. Rightfully so, the experience is awful: it’s bugging, hard to maintain, they don’t migrate well, and generally cause more harm than good.

Officially, Microsoft has recently admitted InfoPath forms are finally being retired and a new forms method (TBD) will be investigated. In a January 31st, 2014 post, the office team declared:

“We are looking to make investments that allow you to easily design, deploy, and use intelligent, integrated forms across Office clients, servers, and services—forms that everyone can use on their PC, tablet, or phone.”

Finally. Heavily relying on InfoPath forms today? The InfoPath 2013 desktop client and InfoPath Forms Services for SharePoint Server 2013 will continue to be supported through 2023 as part of Microsoft’s Lifecycle support policy. You’ve got until April 2023 to figure that one out; however, I wouldn’t bank on a smooth migration solution to whatever comes next. 🙂

SharePoint On-Premises vs. Cloud

Posted by on April 27, 2013 at 7:45 am.

I saw this and thought it was too funny not to post. Credit for this one goes to my colleague Mr. Jody Finch (I’d recommend checking out his awesome blog series on SharePoint Search).

photo

I’m Speaking at SharePoint Saturday!

Posted by on April 23, 2013 at 9:00 pm.

It’s been far too long since I’ve posted, but now’s a good a time as any. I’m going to be speaking at both SharePoint Saturday Boston this Saturday (4/27) and also SharePoint Saturday Baltimore again this year (5/18).

Details on both are below. I know SPS Boston is already sold old (tickets went quick!) but I’ll make my slides and demo available after the event.

spsboston_logo SharePoint Saturday Boston
April 27th, 2013
www.spsboston.org
2012_SPS_Logo_300 SharePoint Saturday Baltimore
May 18th, 2013
www.sharepointsaturday.org/baltimore

Add Column to Default View Using PowerShell

Posted by on September 10, 2012 at 8:49 am.

Recently I had a request from a client to add a custom site collection column to all document libraries. This is pretty easy though the SharePoint UI of course, by creating a custom Site Column in the collection and adding it to the ‘Document’ content type.

However, in doing this the column is not added to the default view for any document libraries. This can be easily done using PowerShell using the script below. This adds the column to the default view in every document library throughout the entire site collection (referenced here).

$site = Get-SPSite “http://sharepoint.com”
$column = “Column”

$site | Get-SPWeb -limit all | ForEach-Object {

# Get all document libraries
$lists = $_.Lists | where  {$_.BaseType -eq “DocumentLibrary”}

# Loop libraries
for ($i = 0; $i -lt $lists.Count; $i++)
{

try
{

# Get current view
$view = $lists[$i].DefaultView

if($view)
{

# Delete if already exist
while($view.ViewFields.ToStringCollection().Contains($column))
{

$view.ViewFields.delete($column)
$view.Update()

}

# Add column
if(!$view.ViewFields.ToStringCollection().Contains($column))
{

$view.ViewFields.add($column)
$view.Update()

}

}

}
catch [Exception]
{

write-output (”  Error: ” + $_.Exception.ToString())

}

}

}

$site.Dispose()

You can also add views to a view by URL and view name for one specific view or list (a nice tip I found here). Here is another option by using GetViewFromUrl:

$spWeb = Get-SPWeb -Identity "http://mySharePoint"
$spView = $spWeb.GetViewFromUrl("/Lists/MyList/AllItems.aspx")
$spField = $spList.Fields["MyField"]
$spView.ViewFields.Add($spField)
$spView.Update()

You can also try to use SPList object as below:

$spList = Get-SPList -Url "http://mySharePoint/Lists/MyList"
$spView = $spList.Views["All Items"]
$spField = $spList.Fields["MyField"]
$spView.ViewFields.Add($spField)
$spView.Update()

Adding multiple columns to a view can also be done with PowerShell, and even create a new view and set it as the default view. This is really awesome if you want to leave the default ‘All Items’ view in tact, but create a new custom view and set it as default (found here):

Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
$siteURL = "http://dev1share"
 $site = Get-SPSite($siteURL)
foreach($web in $site.AllWebs) {
$listCounter = $web.Lists.Count
 for($i=0;$i -le $listCounter;$i++) {
    $list = $web.Lists[$i]
     if($list.BaseType -eq "DocumentLibrary") {
     $newList = $web.Lists.item($list.ID);
  $viewfields = New-Object System.Collections.Specialized.StringCollection
   $viewfields.Add("DocIcon")
   $viewfields.Add("LinkFilename")
   $viewfields.Add("_UIVersionString")
   $viewfields.Add("Modified")
   $viewfields.Add("Created")
   $viewfields.Add("Editor")
   $viewfields.Add("FileSizeDisplay")
  [void]$newList.Views.Add("Detailed", $viewfields, "", 100, $true, $true)
   $newList.Update();
  $view=$newList.Views["Detailed"]
   $view.DefaultView = $true
   $view.Update()
 }
 }
$web.Dispose();
 }
 $site.Dispose();