PowerShell, SharePoint 2013, SharePoint Administration

Automate Variations in SharePoint 2013 using PowerShell & C#


“Thanks to Waldek Mastykarz for his post, he posted about it but for SP 2010 and only in C#” but then I was able to convert it to Powershell, also thanks to “Eric Soo” for his reply but I was done already but thank you both.”

Let’s Start.. Automating variations settings and configuration so whenever a deployment is needed, you will be ready with your PowerShell scripts.

Manual deployment is time consuming as it is repetitive task, in this post I will let you know how to automate one of those many tasks when it comes to deployment.

SharePoint Variations has a UI which I will show you its steps now;

The steps in this post is for automation of variation in UI, in C# & finally in PowerShell.

  1. Go to “Site Actions” à“Site settings”;
  2. Under “Site collection administration”, click “Variation Settings”,

  3. The code below is in C# for the page above to change or update the “Variation Settings”;



  4. The same code but this time in PowerShell,


  5. Now we need to create labels; go back to “Site Settings”, under “Site Collection Administration” click “Variation Settings”;

  6. I have 2 labels, currently if this is your first time, it will be empty, click now “New Label” (as if you are telling SharePoint List to create new item) since we will do this in the code 😉


  7. Now same code but PowerShell for creating variation labels;



  8. Now to create hierarchies; you should see the labels added as below, click above them “Create Hierarchies”, before creating hierarchies, the values for the labels are “No”,

  9. After creating hierarchies, the values should be yes under “Hierarchy is Created”,
  10. To create Hierarchies in C#,


  11. Now let’s create hierarchies in PowerShell,


     

    Thank you and please write your comments or in case you have any questions.

Advertisements
Standard
SharePoint 2010, SharePoint Administration

Uploading large files to SharePoint


Sometimes we face a need when we upload large files like 100MB, and what happens is error or timeout.. so we can configure 2 different values to over come the timeout and the error.

Step 1: In Central Administration:

This is due a settings in Central Administration.

You can change this by opening to Central Administration > Application Management > select your web application and from ribbon click General Settings and choose “General Settings”

At the bottom, there is a section called “Maximum upload size” you will see the value is 50MB as this is the default .. from here you can change it.

Step 2: in IIS

We need to increase Time-Out settings in IIS 7.0

Right click your site and navigate to Advanced settings

Update SharePoint web.config

  1. The next thing we need to do is increase the execution timeout of the upload page that SharePoint uses (upload.aspx).  The executionTimeout attribute we are adding is an optional attribute, but necessary to prevent timeouts on the page.  It requires an int32 value, which will specify the amount of seconds that a request can execute before it’s shutdown by ASP.NET (the underlying framework of SharePoint pages).  Although this attribute is optional, default timeout for ASP.NET 2.0 is 110 seconds, so any uploads that are taking longer than that will result in the request being shutdown – thus we are going to add the attribute and increase it at the sametime.
  2. To add the value; Navigate your file browser to the SharePointRoot (hive) directory, typically: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS
  3. Open Web.config with a text editor (like Notepad), and add in the executionTimeout=”999999″parameter and value to the upload.aspx setting.

Update SharePoint Web Application web.config

  1. Next, we need to also add the executionTimeout setting to the web.config for our SharePoint Web Application specifically. located here: Inetpub\wwwroot\wss\VirtualDirectories\[YourSiteVirtualDirectoryFolder]
  2. Locate the web.config, and add the executionTimeout=”999999″ parameter and value to the httpRuntime setting

.You are ready to go now to support large file uploads to SharePoint

Standard
SharePoint 2010, SharePoint Administration, SharePoint Updates

MOSS 2007 & SharePoint 2010 April CU is here !


The product group released the April 2011 Cumulative Update for the SharePoint 2007 and 2010 product family.

The KB articles are available:

  • KB 2512783 – WSS 3.0
  • KB 2512782 – MOSS 2007
  • KB 2512804 – SharePoint Foundation 2010
  • KB 2512800 – SharePoint Server 2010
  • KB 2512801 – SharePoint Server 2010 with Project Server

The Full Server Packages for April 2011 CU are available through the following links:

Remember that after installing the fixes you need to run the SharePoint 2010 Products Configuration Wizard on each machine in the farm.

Standard
SharePoint 2010, SharePoint Administration

SharePoint 2010 Installation Error ! in Step 9


I ran into this installation error for more then 4 hours ! I tried lots of stuff to make it & searched a lot till I found this article http://www.mattgrovesblog.com/2009/11/sp2010-installation-error.html#axzz1ssEbtjSV

so the exception I was getting was in step 9 is this;

Image

“An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown.  Additional exception information: An error has occurred while validating the configuration settings.  An exception of type System.ArgumentNullException was thrown.  Additional exception information: The errorData argument cannot be null or zero length.“

After some diagnosis found this was due to the Windows firewall blocking PSConfig from talking to remote hosts!

So, what the error should say is:

Due to the Windows Firewall being enabled the PSConfig cannot create a connection to remote hosts (eg. your SQL server!!). Please allow PSConfig out through the firewall!

Having now created the firewall rule I am making progress!

Of course, some will simply disable Windows Firewall 😉

Standard