Export Term Set to CSV File


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!


Items bulk deletion


Hello everyone,

Today I will talk about the massive removal of elements in SharePoint. Several possibilities exist, but the faster is the use of a batch via PowerShell.

You can find several websites / blogs on “how to create the batch” but for those I tested, I’ve always had a little something to change.

Sample sites :





(by the way, thank you to all authors for their help in understanding the operation !)

In fact it is usually in the parameter “owsfileref” that divergent versions. Some do not specify, some  yes but other ways.

For me, here is the code that I use and that works for library documents and custom list.

Warning! Pay attention to the line


You can see that the values ​​1.0 and UTF-8 are not quoted with a simple  but with `”. I do not know why but the simple  raises an error « Exception calling « ProcessBatchData » with « 1 » argument(s) » when running the script!

Add-PSSnapin "Microsoft.SharePoint.PowerShell"

$urlSite = “http://serverurl”

$listname = “Test”

write-host "Opening site..."

$web=get-spweb $urlSite

write-host "Opening list..."

$list=$web.lists | ? { $_.title -eq $listName}

$spQuery= New-Object Microsoft.SharePoint.SPQuery


$spQuery.RowLimit = 2000

$caml = ""




$listItems = $list.GetItems($spQuery)


$spQuery.ListItemCollectionPosition= $listItems.ListItemCollectionPosition



for($j=0;$j -lt $count; $j++)










if($i -ge $count){break}



write-host "Sending batch..."


write-host "Emptying Recycle Bin..."



while($spQuery.ListItemCollectionPosition -ne $null)


write-host "Process finished"

Hope this helps.


No such host is known


Hello everyone,

Today I’ll talk about an issue with BCS. It happened to me to see the following error message by clicking on an external list.

« Unable to render the data. If the problem persists, contact your web server adminisrator. Correlation Id: XXXXXXXX

Looking at the logs I saw a strange error message:“Possibly the host name ‘ip, port’ is invalid and it’s could not be found. The exception is System.Net.Sockets.SocketException (0X80004005): No such host is known at System.Net.Dns.InternalGetHostByName …


The BCS was created using SharePoint Designer and I can see the tables in it, so why an error “no such host is known” via SharePoint?

After digging a while I finally found the solution. The problem came from the Secure Store! Indeed, my user account was not specified in the “Members” section of the secure store!


Using SharePoint Designer, I could see the connection because I specified to use the credentials stored in the secure store, but my user does not belong to the Secure Store “members”, so when I browse the list in SharePoint, it does not use these credentials!

A stupid error, but an error message, once again, not very useful …

Hope that helps