Download all files from library

pnp logo

Hello everyone,

Today I’ll share a little PowerShell script I made some time ago. It allows you to download all files of a single library, looping through all subfolders. This script use PNP PowerShell .

It was done for Office365 but should work the same way for onpremise. You just need to update the parameter on the top and run it. It will prompt you for your credentials to access the site and then download all the files to the specified directory (creating it if it doesn’t exist)

Hoping this helps!

Christopher

 

Advertisements

An object in the SharePoint administrative framework, ‘SPSolutionLanguagePack Name=0’, depends on other objects which do not exist

SP2013


Hello everyone,

Today I’ll talk about an error message which may occurs when you run PowerShell queries.

« An object in the SharePoint administrative framework, “SPSolutionLanguagePack Name=0”, depends on other objects which do not exist. Ensure that all of the objects dependencies are created and retry this operation.”

Some post suggest editing the file cache.ini within the timer service or to run an “IISRESET.” Before doing this, try to launch again your PowerShell command prompt and retry your command. If it has been active for a long time it may be that some connection are closed and this may result in this kind of error.

Hope this helps.

Christopher.

Disable column content edition

SP2013


Hello everyone,

Today I will talk about a sometimes requested feature : prevent change a field in a SharePoint list in edit mode.

If prevent the display of a field in the edit mode of a list can be easily done via PowerShell, do not forget that users can go through the “Quick Edit” mode of the list and bypass this configuration.

To completely prohibit the modification of a field after the creation of the item, you have to go through these two steps: Do not display the field in edit mode field and disable the DataGrid view.

If the second part can be done via the “List settings” menu of the list, the first requires a little development (PowerShell script or Visual Studio Development).

PowerShell is faster to set up, so here is the script to perform those two actions:

Add-PSSnapin Microsoft.SharePoint.PowerShell –erroraction SilentlyContinue

$siteUrl=”Site url”

$ListUrl=”List relative url”

$columnName =”Column Name”

$web = Get-SPWeb -Identity “$siteUrl”

$list = $web.GetList($web.Url + $ListUrl)

$list.Fields[$columnName].ShowInEditForm=$false

$list.Fields[$columnName].Update()

$list.DisableGridEditing=$true

$list.Update()

$web.Dispose()

 

Hope this helps

Christopher

Set Continuous Crawl Interval

SP2013


Hello everyone,

Today I’ll talk about the configuration of the continuous crawl.

For those who do not know, the continuous crawl is a new feature of SharePoint 2013 that allows you to crawl new content “continuously”.

It is configurable in the “Content Source” where you have to choose between “Enable Continuous Crawls” and “Enable Incremental Crawls“.

Be honest, this is not true continuous but is not far from being. the default job is run every 15 minutes. Note that this job will start in parallel, it is not expected the end of the previous job to start.

If you want to change this interval, you must go through the following PowerShell command (replacing 1 by the desired number of minutes)

Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue

$ssa = Get-SPEnterpriseSearchServiceApplication

$ssa.GetProperty(“ContinuousCrawlInterval”)

$ssa.SetProperty(“ContinuousCrawlInterval”,1)

$ssa.GetProperty(“ContinuousCrawlInterval”)

 

Note: “GetProperty” are not necessary, they will allow you to view the current value before and after modification.

Attention: Please note however, the crawl takes resources and could have an impact on your performance (in case of very large volume of data). Use with caution!

 

Hope this helps!

Christopher

Remove orphaned feature

SP2013


Hello everyone,

Today I’m going to talk about a problem that can happen in a development phase.

When you test your solutions, you may find yourself confronted with this kind of error when deploying:

Sorry, something went wrong

A feature with ID 15/{GUID} has already been installed in this farm. Use the force attribute to explicitly re-install the feature.

First of all, you can delete the feature using this PowerShell command

$feature = Get-SPFeature | ? { $_.Id -eq “{GUID}” }

$feature.Delete()

If you want to do some prevention, you can also run this one which will display all the orphaned feature (meaning they was rectracted unproperly and prevent you for active them again during deployment)

Get-SPFeature | ? { $_.Scope -eq $null }

The tips to display orphaned feature comes from this post: http://sharepoint.stackexchange.com/questions/16525/how-to-remove-orphaned-features thanks to the author!

Hope this helps.

Christopher.

 

Assembly not updated when working with Windows PowerShell ISE

SP2013

Hello everyone,

Today I will talk about a problem I encountered when using PowerShell. I was testing events handlers by making updates via PowerShell when I realized that the corrections that I brought to my code weren’t updated!

Example, I did a test on the contents of a field, I changed it in the source code, deployed my update but when I attacked with my script, it was always the first version of the code that was returned!

In fact I realized that using my script via Windows PowerShell ISE does not take my updated source code while I don’t restart the ISE application!

Maybe it keeps a cached copy?

Hope this helps !

Christopher.

Export Term Set to CSV File

SP2013

Hello everyone,

Today, I’ll do a little advertising for PowerShell script that I found very useful. This script allows you to export a Term Set in a csv file. Very useful to migrate the contents of term store from one environment to another!

You can find this script here: http://gallery.technet.microsoft.com/office/PowerShell-for-SharePoint-a838b5d0/view/Reviews

As a reminder, to import a csv file, just go in the term store, click on the arrow at a group level and click “Import Term Set”.

Hope this helps!

Christopher.