Category: SharePoint 2010

Change existing list’s URL using Powershell

Today I was faced with the challenge of changing an existing list’s URL in SharePoint 2010. I found a simple way to do this using SharePoint Designer, but I wanted to be able to do this using Windows Powershell. It turns out this is pretty easy and can be accomplished by using the following script snippet:

$site = Get-SPWeb http://yourwebapplication/yoursite/
$site.Lists["ListName"].RootFolder.MoveTo("NewListName")

The script snippet above will change the URL of the list.

Passed Microsoft Certification exam 70-576

Studying for a Microsoft certification exam can be hard and daunting, but I finally took the opportunity to study hard in order to pass the 70-576 (PRO: Designing and Developing Microsoft SharePoint2010 Applications) Microsoft Certification exam, which I did January 10 with a score of 899 in total. I will not say it was an easy task, but in this blog post, I will try to summarize the resources I made use of to pass this exam.

Books
I always use books when preparing for Microsoft Certification exams, and if I cannot find a corresponding Microsoft Press book, I usually prefer books from Wrox and Apress. This was the case with the 50-576 exam, so I used the following books:

Professional SharePoint 2010 Development
Professional SharePoint 2010 Administration

I also found the following book, on Amazon, but the status on Amazon is currently unavailable and they do not know release date: SharePoint 2010 Developer’s Certification

MSDN
The Microsoft Developer Network provides the SDK documentation, and many technical articles about SharePoint 2010 development. This is a very good resource for learning all the corners of SharePoint 2010. I usually use the Microsoft Developer Network together with the books mentioned in the previous section. When I discover something unclear or something I do not understand, I go to the Microsoft Developer Network where I usually find all the information I need.

Online resources
There is tons of online resources besides the Microsoft Developer Network. Below are some of the resources I found very helpful during my study.

Study guide to the exam 70-576: Microsoft SharePoint 2010 Designing and Developing
This study guide was created by Pedro Pinto and covers almost everything in the exam. This is a highly recommended read if you are serious about passing the 70-576.

SharePoint on StackExchange
This Q&A site is a part of the StackExchange network and is widely known by developers around the world. You’ll find answers to most of your questions here.

Round up
I hope the information was helpful if you are considering passing 70-576. I would say it is highly recommended since you will learn a lot about SharePoint development. Have fun studying.

Removing web.config modifications using Powershell

In many custom SharePoint solutions the SPWebConfigModification class is often used to persist changes to the web.config file for a given web application in the farm. This is a very good way to keep track of your changes to the web.config file through feature activation on a web application level.

But sometimes you’ll need to remove an entry in a web.config file for a given web application. This could be a safecontrol, an AppSetting or a ConnectionString. It is generally not a good idea to remove this manually, since inconsistency between the web.config file and the content database will occur and that is not good.

Powershell can help you remove an entry in the web.config file properly. See the following example:

$webApp = Get-SPWebApplication "http://yoursite"
$config = $webApp.WebConfigModifications | Where-Object {$_.Name -eq "add[@name=['Session']" -and $_.Path -eq "configuration/system.web/httpModules"}
$webApp.WebConfigModifications.Remove($config)
$webApp.Update()
$webApp.Parent.ApplyWebConfigModifications()

The example above will remove the modification with the name add[@name=[‘Session’] and path configuration/system.web/httpModules. The ApplyWebConfigModifications() function which is called at the end of the script will apply the changes to the web.config file across the farm.

Studying for the 70-576 exam

I am currently studying for the 70-576 exam which is titled “PRO: Designing and Developing Microsoft SharePoint 2010 Applications” and from the looks of the “Skills Measured” tab on the exam website, I will have a lot of reading and experimenting in front of me. Be prepared for some new blog posts on the way once I go through each subject carefully.
Since I already have the 70-573 exam (MCTS: Microsoft SharePoint 2010, Application Development), I will become a MCPD if I pass the exam mentioned above.

There are currently no Microsoft Press books available for the exam, so I will have to do with TechNet articles, resources from blogs and the “Professional SharePoint 2010 Development” book from Wrox. Although I found a study guide for the 70-576 exam by Pedro Henrique Araújo Rodrigues Pinto on his blog which might come in handy. The study guide can be found here.

Unable to open PDF in SharePoint 2010

Today I received a question from a client. “Why am I unable to open PDF files directly from my SharePoint 2010 portal? The system wants me to save the file instead?”. This was an interesting question and I started digging.
I found out that if you have a default installation of SharePoint 2010, the behavior above will occur. SharePoint forces you to save the PDF file and you have no option to open the file directly from within SharePoint 2010.

Luckily you are able to change this behavior by following the instructions below

  1. Go to SharePoint 2010 Central Administration > Application Management > Manage Web Applications.
  2. Select your web application from the list.
  3. Choose General Settings in the ribbon.
  4. Scroll down to Browser File Handling and select Permissive instead of Strict.
  5. Click OK.

You should now be able to open PDF files directly from SharePoint 2010.

The solution above can also be carried out programmatically. This will be a new blog post.