Skip Ribbon Commands
Skip to main content

Ben There, Done That

:

SharePoint Ben > Ben There, Done That
A SharePoint Blog about where I've been with SharePoint, what I've done with SharePoint, and anything else SharePointy, I care to blog about.
January 20
Using PowerShell to “hide” folders in a SharePoint List View

So here it is, my first post of 2012.  I’ve been doing a lot with PowerShell and SharePoint lately and really been enjoying it.  However, this one tasks had be stumped for a while.  Within a SharePoint view, under the “Folders” section you have the ability to specify either “Show items inside folders” or “Show all items without folders”.  The view works great if you want to offer your users a view to see all content without that content being buried within folders.

Our problem came in that we were provisioning the entire site (including views) using PowerShell.  So, how to set this in via PowerShell.  I couldn’t find ANY properties relating to folders for a List view.  After a few hours and some digging I found that it done by setting the view scope to recursive.  It actually does make some sense when you think about it.  So, here is the PowerShell needed to “hide” folders within your SharePoint list view:

$web = Get-SPWeb "http://intranet.sharepoint.com"
$doclib = $web.Lists["Shared Documents"]
$view = $doclib.Views["All Documents"]
$view.Scope = [Microsoft.SharePoint.SPViewScope]::Recursive
$view.Update()
December 23
Merry Christmas and a Happy New Year!!

Merry Christmas and a Happy New Year to everyone!  I hope and trust everyone has had a blessed year, despite any hardships that may have transpired in the last 12 months.  As for me, I’ve had a wonderful year of consulting as well as some great times personally with my wife and family.  This year has also brought with it some trials and difficult decisions.

Over this last year my wife and I have had the great opportunity of being able to spend a week up in Michigan camping with my family as well as going on a Disney Cruise with my wife’s family in June.  Additionally in July we were able to get away for a few nights to St. Simons Island, GA to celebrate our second anniversary.  This Christmas we have also been able to spend additional time with family in Michigan and out in Colorado.

As for work life, a couple of weeks ago I made the difficult decision of resigning from my position as a Sr. SharePoint Architect with EPC Group.  It has been a privilege to work with several different individuals and clients over the past year and I have continued to hone my skills as a SharePoint consultant and increase my SharePoint knowledge as a result of working with these individuals and clients.

For what’s next?  I have a few things brewing so for now, all I’ll say is stay tuned to my blog/Twitter/Facebook feeds for additional updates coming sometime in 2012.

I hope everyone has a Merry Christmas and in all of the celebrations, remembers what we are really celebrating this time of year (and it’s not Santa). 

      “For to us a child is born,
      to us a son is given;
                  and the government shall be upon his shoulder,
      and his name shall be called
                  Wonderful Counselor, Mighty God,
      Everlasting Father, Prince of Peace.” -
The Holy Bible: English Standard Version. 2001 (Is 9:6).

November 22
Macbook Pro + Hyper-V = Issues

So, recently I decided to install Windows Server 2008 R2 on my MBP (late 2010 model) rather than using Mac OS with VMWare Fusion.  I won’t go into all the details around this decision, however I did encounter one big surprise.  This one being a nightmare with Hyper-V.  I liked the idea of being able to run Hyper-V for VM’s on my MBP, specifically Windows XP for using VPN with some clients.  Also, I could easily manage and connect to my Hyper-V server running at home.

After getting everything all set and spinning up Hyper-V with a Windows XP VM, my laptop was dog slow!! I have an SSD hard drive, 8 GB of RAM and a dual core proc…no way everything should be this slow.  My video was also doing REALLY weird things, this I chalked up to the fact that I was using my laptop display and two external monitors (making use of the display port as well as an external USB “video card”).

So, what did I do? Some searching for what could be the issue.  I started seeing some posts about issues with Hyper-V and certain nVidia video cards in laptops causing weird behavior with Hyper-V.  Hm….slow computer and video issues??  So, I uninstalled the Hyper-V role and success!! My laptop runs much smoother AND, as a bonus, my video now is much better.  I went back to VMWare and am now using Workstation 8 on my MBP with very good success and just using the Hyper-V management tools to connect to my server without any issues.

November 14
Uploading Large Files to SharePoint 2010 Using the Client Object Model

Recently I've been working on a solution that required using the client object model to upload large files to SharePoint. Not having a development background, I started searching for the best way to accomplish this task. I came across this helpful blog post that gave me a good start. I followed all the recommendations in the post and went with the HTTP DAV method mentioned second in the post.

However, I was uploading batches of files and getting a sporadic error stating:

System.Net.WebException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

After hours searching and trying different attempts at fixing it without any progress I decide to switch back and use the client library batch mechanism mentioned first in the article. This worked much more consistently, but I was getting the "The remote server returned an error: (400) Bad Request." That was mentioned. I figured it was the easy fix of increasing the message size, however, this didn't fix my bad request error. Back to searching and I ran across this MSDN KB article about the issue. Come to find out there is are actually two lines of code not mentioned in the first link I referenced that were important to get the solution working.

  1. This one was mentioned further down in the comments, but it is to have clientContext.Load(doclib)
  2. This one was only in the second KB article and it was to have clientContext.Load(web)

After adding these two lines of code to my solution all files in the batch were consistently uploading via the object without any problems.

This may be common knowledge to some developers, but hopefully it can be helpful to some of you aspiring SharePoint developers out there.

November 02
Hiding Folders in a Document Library View Using Powershell
I've been doing a lot of work with Powershell and SharePoint lately.  One of the things I've been doing is building out several list/document library views with Powershell.  In some of those views, the client has wanted to just see all of the files in a flat file structure (rather than having to drill through the folders).  I actually struggled for a little while trying to find the solution in Powershell.  After some digging and trial and error I discovered the solution.

$web = Get-SPWeb "http://intranet.sharepoint.com"
$doclib = $web.Lists["Shared Documents"]
$view = $doclib.Views["All Documents"]
$view.Scope = [Microsoft.Sharepoint.SPViewScope]::Recursive
$view.Update()

In this case, the name of the document library was Shared Documents and I had already created a view call All Documents.  After running this script, the All Documents shows all of the files in a flat file view for the document library.



October 21
Displaying Silverlight (.xap) within your website in Firefox

So just a quick little blog post for a Friday about a small variation I found the other day while working on a SharePoint web part. We had a need for our web part to display Silverlight and have a transparent background as well as a div floating over the Silverlight. So I wrote a quick little visual web part that included the div and displayed the .xap file. The web part worked fine in Safari and Chrome on the Mac, and IE, Safari and Chrome on Windows, but the .xap file wouldn't load in Firefox on either platform.

So, I resorted to Google and found this post - http://www.codeproject.com/Tips/88917/Problems-with-Silverlight-media-player-in-Mozilla apparently, for any browser based on Firefox, when you declare data="data:application/x-silverlight-2" within your object, you need to include a , at the end of the string.

I updated my code to check the browser and then use data="data:application/x-silverlight-2," for Firefox and to use data="data:application/x-silverlight-2" for any other browser. As soon as that fix was in place on my web part, the Silverlight loaded fine across all the browsers and both platforms.

October 01
Pre-SharePoint Conference 2011 in Pictures

So, The SharePoint Conference hasn't even started yet, but I've managed to get some pictures as my wife and I have been enjoying a few days together out here before the craziness of the conference hits.  Here are our experiences to date.

IMAG0166.jpg
My Wife Excited for the Disneyland Private Party (yes, I bought her a ticket too so she could join us)

IMAG0167.jpg
The SharePoint Conference banner hung at the convention center

IMAG0168.jpg
Anaheim GardenWalk (lots of good restaurants around here)

IMAG0169.jpg
The top item on my Christmas list in the LEGO store

IMAG0171.jpg

The floor of the our hotel (the Marriott Anaheim)

IMAG0170.jpg
The mountain view from our hotel room

IMAG0177.jpg
The start to EPC Group's booth

IMAG0180.jpg
The booth much closer to being completed, almost ready for the start of the conference tomorrow.


​So, there you have it...the our Pre-SharePoint Conference experience in pictures.  I'll do my best to keep blogging and posting even more pictures thoughout the conference.  If you're out here and readin this feel free to stop buy the EPC Booth or shoot me a tweet (@SharePointBen​).  Hope to see you!! 
 
 
 

September 30
SharePoint 2010 Search, Gantt Chart Bug?

​I can neither confirm nor deny this is a SharePoint bug, but it is something I have received the same results from on three different farms.  I would be curious if others have encountered this or have any insight into the issue.

 

So, what exactly is the issue?  When running a search crawl, you get an error similar to “The crawler could not communicate with the server.  Check that the server is available and that the firewall access is configure correctly”.  Now for the unique part, you get this error when crawling the Gantt chart view/page on any of your sites.

gantt-chart-bug.jpg


I’ve found that every other view/page in the list is crawled fine and there are no other issues crawling the content.  If you have multiple lists with a Gantt chart view, you get this issue for every one of them.

 

For now we have just inserted a crawl rule to exclude any of our Gantt chart views.  The sites are created from templates so every view as the same name, so in our case it is relatively easy.  However, I know this isn’t the case for everyone.

 

So, has anyone else experienced this?  Does anyone know if this is a known bug within SharePoint search or if it’s just a fluke that I experience it in 3 different SharePoint 2010 farms?  I would love to get some feedback on this.

September 06
User Profile Synchronization, New Connection Domain Container Won’t Expand

​The other day I was working with a client setting up the UPS Connection to their Active Directory.  Everything was going fine until we tried to expand the Active Directory tree to select the appropriate Organizational Units to synchronize.

We would click to expand it, and ever about 5 minutes we would receive an error stating, “The operation was aborted because the client side timeout limit was exceeded”.  We attempted to increase the timeout values according to this article on TechNet - http://technet.microsoft.com/en-us/library/ff681014.aspx#timeouts.

No matter how high we increased the timeout value, we continued to receive the error after about 5 minutes.  After continuing to search for answers, we ran across this string in the SharePoint Forums - http://social.technet.microsoft.com/Forums/en/sharepoint2010setup/thread/3ffb5c99-176f-425e-9409-0fbb6762bf17.  The solution to our problem was to open the Local Computer Policy on the server running UPS and browse to Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options and set network security:LDAP client signing requirements to none.

editGPO.jpg

Once you’ve made this change, restart the two UPS Services in the “Services on Server” in your SharePoint Central Administration.

Once this has been done, you should be able to go back into your UPS connections and expand the Active Directory tree to pick the appropriate Organization Units for your synchronization connection.

August 17
SharePoint 2010 UPS Exclusion Filter – Unexpected Error

Have you ever gotten an Error - Unexpected Error has occurred when submitting your exclusion filter settings to your User Profile Service connection? Check and make sure you don't have a filter looking for a blank property.

When you set up your exclusion filter for your UPS connection, setting an exclusion rule for something like company equals an empty string (see screen shot) you'll get this error when clicking ok.

SP-InvalidRule.png 

Its rather deceiving as it will let you add the rule on the page, but only error on clicking ok. We ran into it after defining about 6 different exclusion rules, clicking ok, and getting an unexpected error. We had to go through our rules one at a time until we realized it was just the blank rule.

So, instead of checking for a blank string, you should use the "Is not present" rule, if looking for a blank field in your user profile service connection.

SP-ValidRule.png

 

1 - 10Next
​​