How to: get a number of lists and lists items for SharePoint site collection

The fastest way to do it is to use following PS script:

Add-PSSnapin Microsoft.Sharepoint.Powershell
$ListsInfo = @{}
$TotalItems = 0
$SiteCollection = Get-SPSite ""
ForEach ($Site in $SiteCollection.AllWebs)
ForEach ($List in $Site.Lists)
$ListsInfo.Add($Site.Url + " - " + $List.Title, $List.ItemCount)
$TotalItems += $List.ItemCount
$ListsInfo.GetEnumerator() | sort name | Format-Table -Autosize
Write-Host "Total number of Lists: " $ListsInfo.Count
Write-Host "Total number of ListItems: " $TotalItems

It will count all the lists and number items inside of these lists, plus output total lists number and total items number in all lists for site collection URL of which you specify in 4th line of this script. This script works both for SharePoint 2010 and 2013.

Upgrading to K2 blackpearl 4.6.8: Constrained delegation is not enabled for the Active Directory account”

OK probably not a timely post given the fact that 4.6.9 is about to become available, but anyway. The other day I was asked the following question:

“We upgrading from 4.6.5 to 4.6.8, and getting an error in K2 Confguration Analysis:

Analysis Result: Failed.
Contrained delegation is not enabled for the Active Directory account: %SERVERNAME%
The K2 Windows Token Service is a Windows Identity Foundation (WIF) feature that extracts UPN claims from SAML tokens and generates Windows security tokens. This allows K2, as the relying party, to impersonate a claims user for access to a line of business system, such as SQL.
Important: If you have configured Kerberos in your environment, a domain administrator must configure constrained delegation in Active Directory. For more information see the link below.
URL, : Text How To: Use Protocol Transition and Constrained Delegation in ASP.NET 2.0 (MSDN)

This seems to be strange as all (including Kerberos stuff) was configured for 4.6.5, why this error? What’s new was added in 4.6.8 that gives us this error/requires extra configuration steps?”

Well at the time I was asked this there was no nice K2 KB published, but it is available now and explaining this neatly – KB001607 – Delegation Settings to enable K2 Windows Token Service to impersonate using Kerberos.

Basically 4.6.8 introduced K2 Windows Token Service which is installed on the all servers where K2 Designer, K2 smartforms Runtime and K2 View Flow components are installed. Things to know about it:

- K2 Windows Token Service is a Windows Identity Foundation (WIF) feature that extracts UPN claims from SAML tokens and generates Windows security tokens. This allows K2, as the relying party, to impersonate a claims user for access to a line of business system, such as SQL.

- Installed on the all servers where K2 Designer, K2 smartforms Runtime and K2 View Flow components are installed

- It runs under the local system account

- If Kerberos is being used in environment (which is the case for most production deployments), a domain administrator must configure constrained delegation for HTTP for both the server name as well as the FQDN for each of the following servers: K2 smartforms runtime server, K2 Designer server, K2 Workspace server (this hosts the K2 View Flow component)

-  Even if constrained delegation was previously configured for these servers when older than 4.6.8 version of K2 was installed you need to add the constrained delegation settings required for the K2 Windows Token Service (see above)

Well statement ” K2 Windows Token Service is a Windows Identity Foundation (WIF) feature that extracts UPN claims from SAML tokens and generates Windows security tokens. This allows K2, as the relying party, to impersonate a claims user for access to a line of business system, such as SQL.” seems to be clear, but if you really want to understand it you need to know all the terms/concepts mentioned :)

So some definitions below:

By itself WIF is a Microsoft software framework for building identity-aware applications, which provides APIs for building ASP.NET or WCF based security token services as well as tools for building claims-aware and federation capable applications. It used to be shipped as separate product, but now it is part of Microsoft .NET Framework v4.5.

And as per Microsoft documentation:  “Any service that relies on the Claims to Windows token service (C2WTS) must use Kerberos constrained delegation to allow the C2WTS to use Kerberos protocol transition to translate claims into Windows credentials.”

Nietzsche & Bodybuilding :)

Not so long ago I discovered very good blog about serious literature where the author tries to give his own interpretations to the great works of literary classics, posts there are dense and try to uncover main ideas contained in literary works and what was possible meant by their authors. And more over each post accompanied with short YouTube video (on average 5 mins) where blog’s author speaks about the book in question with some presentation/graphic material. Here is the link to this blog: The Great Conversation

I should admit that the amount and quality of content in this blog is amazing, and personally I’m going to follow it :) Also if you a bit into great literature and on look out for thoughts and ideas which literature contains in abundance, you may be interested in this blog too.

Now to the topic of this post of mine. :) “Nietzsche & Bodybuilding”, where is connection you may ask? :) Well in the analysis of Nietzsche’s “On suffering”  which you may find on aforementioned blog author draws some parallels between Nietzsche views on suffering and bodybuilding. Though it is a bit unclear to which particular work/works of Nietzsche this blog post corresponds to (looks like it is about Nietzsche views on suffering in general) I enjoyed it anyway.

Let me quote a bit from this post:

Nietzsche claims that man is composed of two parts – a creative part and a part that is created – in other words, mind and body. According to him, the body is meant to suffer, and the mind is meant to fashion something beautiful out of the suffering of the body. “In man creature and creator are united: in man there is material, fragment, excess, clay, dirt, nonsense, chaos; but there is also the creator, the sculptor, the hardness of the hammer, the divinity of the spectator, and the seventh day – do you understand this contrast? The body must be fashioned, bruised, forged, stretched, roasted, and refined – it is meant to suffer.”

An athlete, such as a bodybuilder, is the epitome of this idea. A bodybuilder subjects his body to the pain and suffering of training in order to create a physique that is aesthetically pleasing. The weightlifting adage, “No pain, no gain,” is an echo of Nietzsche’s ideas.

It is also somehow reminded me about one of the best essays on working with weights I read so far – Iron and the Soul by Henry Rollins. This one may interest you if you are avid gym goer or just thinking about what it gives or may give you.

As a person interested both in literature/ideas and sport I found these parallels interesting. Another interesting thing I learnt for this blog so far is the fact that Einstein once said that “Dostoevsky gives me more than any scientist” (this is from the post  DOSTOEVSKY: The Brothers Karamazov)

French Vocabulary: Saisons – Météo



climat [klima] - climate

doux [du] – soft/warm

clément [klemɑ̃] – soft/warm (about weather and temperature)

rude [ʀyd] - harsh/severe/inclement (origin – early 17th century from French inclément or Latin inclement-, from in- ‘not’ + clement- ‘clement’)

humide [ymid] - humid (also: moist, damp, dewy)

sec [sɛk] – dry/arid

pluvieux [plyvjø] – rainy (showery/wet)

temps [tɑ̃] – weather

temps couvert [kuːˈvɛː] (chargé, gris) – the weather is dull/cloudy/overcast

gros temps – storm on sea

il fait beau/mauvais temps – good/bad weather

un temps de saison – normal/usual weather (for particular season)

le temps est à la pluie, à l’orage – It is going to rain/it looks like rain/thunderstorm

le temps est au dégel – thaw is about to start

le temps se met au beau — the weather is improving/becomes fine

Le temps est agréable – The weather is good

Il fait [fɛ] beau [bo] – The weather is good

Il fait du soleil / Il y a du soleil – It is sunny

Il fait doux – It is soft/warm

Il fait chaud [ʃo] /  Il fait bon [bɔ̃] – It is hot / warm.

chaleur (f) [ʃalœʀ] – heat; heat wave; hot weather

Il fait frais [fʀɛ] – It is fresh/cool

Il fait un temps magnifique [maɲifik] / splendide [splɑ̃did] – The weather is splendid

Le temps est clair – It is fine/bright/clear

Le temps est désagréable – The weather is bad

Il fait mauvais [mɔvɛ] – The weather is bad

Il fait gris [gʀi] – it is cloudy / overcast / lowering, louring

Il fait lourd [luʀ] –  the weather is heavy

Il fait humide – It is humid

Il fait froid [fʀwa] – It is cold

Il fait du vent – It’s windy

Il fait du brouillard [bʀujaʀ] – It’s foggy

Il fait  nuageux – It’s cloudy

Il fait orageux – It’s stormy

Il pleut des cordes – It’s pouring rain

Il tombe de la grêle – It’s hailing

la grêle – hail

une flaque [flak] – puddle, pool

une mare [maʀ] – large puddle/pool; pond

Il gèle [ʒ(ə)le] – It is freeze (морозит, подмораживает)

Il fait un temps affreux [afʀø]/épouvantable [epuvɑ̃tabl] - The weather is foul/miserable.

Le temps est stable [stabl] – Weather is stable/unchanging

Le temps s’améliore [ameljɔʀe] – The weather is improving

Le temps se dégrade – The weather becomes worse

Le ciel [sjɛl] se dégage – The sky is clearing

Un vent – Wind

fort [fɔʀ] – strong

glacial [glasjal] – ice; icy, ice-cold, chilling, glacial

léger [leʒe]/faible [fɛbl] – weak

orage [ɔʀaʒ] - thunderstorm

tempête [tɑ̃pɛt] – storm/tempest

éclair [eklɛʀ]/foudre [fudʀ] – flash of lightning/lightning with thunder (thunderstorm)

tonnerre [tɔnɛʀ] - thunder

Quelle canicule! / C’est la canicule! [kanikyl] – hot wave

Quel temps fait-il? – How is the weather?

Les températures baissent/sont en baisse – The temperature is falling

Les températures montent / sont en hausse – The temperature is rising

Les températures restent stables – The temperature is unchanging

Il fait 30 à l’ombre – It is 30 degrees in shade.


Il fait un temps de chien – Terrible weather; or as an author of good post about this french idiom puts it “Chicago weather” (they tell that chicagoans live under gray skies for about 70% of the year)

ça caille – it’s very cold

Some related YouTube videos

French Weather Vocabulary:

Learn French – French Weather Vocabulary:

French Lesson 35 – Describe THE WEATHER Common expressions LE TEMPS CLIMAT Il fait froid chaud:

French lesson 8 – The four seasons in French – Les saisons – Las estaciones Cursos Clases de Frances:

K2 Process Instances report: “This report has been limited to 1000 rows”

The other day I was asked about default limit you may see in K2 workspace when accessing, for example, Process Instances report for particular process (K2 Workspace > Process Overview > Process Instances).


Here is the message about default limit which you may see when surpassed it (This report has been limited to 1000 rows):


Well the main difficulty for me was that in my test environments I don’t usually see that much process instances, so to reproduce and verify respective settings was kind of a problem for me. There is a section at which mentions briefly configuration setting we need to adjust but not exactly and without going into much of details – Custom Reports – Create Report Wizard. From there we may infer that the setting we need to adjust is “RowLimitRecordCount“, and the next thing is to change it and test. But like I said testing this may be difficult if you don’t have 1000+ process instances running in your environment (it could be that your test environment even doesn’t have any process deployed yet). And you don’t want to run 1000+ process instances by doing 1000+ mouse clicks, right? Let’s consider how to go about this problem first.

Luckily enough at you may find information on “Starting a K2 Process using the Windows Powershell” which is a good starting point for solving our little problem. So starting from that I created following PS script running number of process instances required for my test:

$i = 0
Do {
[System.Console]::WriteLine("Starting K2 process instance #" + $i)
Add-Type -AssemblyName ('SourceCode.Workflow.Client, Version=, Culture=neutral, PublicKeyToken=16a2c5aaaa1b130d')
$conn = New-Object -TypeName SourceCode.Workflow.Client.Connection
$pi = $conn.CreateProcessInstance("Project_Name\Workflow_Name")
While ($i -lt 1000)
[System.Console]::WriteLine("Done: " + $i + " process instances started")

This code will run as much instances of a specified process as you specify in “While ($i -lt 1001)” line (lt is quite queer/unconventional operator which PS uses for “less than”). Another line you most likely have to edit is “$pi = $conn.CreateProcessInstance(“Project_Name\Workflow_Name”)” – I hope this is quite self-explanatory.

If you don’t have any workflows deployed then for this particular test all you need is just go to K2 studio and drop Default Client Event and next terminate it with Placeholder Event, then deploy this test workflow. Process with only Placeholder Event won’t suffice for this test as its instances will go into completion immediately and you won’t get multiple instances running simultaneously with such process.

Once you have large number of instances running you may see the message about the row limit mentioned in the beginning of this post and test change of “RowLimitRecordCount” value. Now it’s high time to adjust the RowLimitRecordCount value in web.config file located in <install drive>:\Program Files (x86)\K2 blackpearl\WorkSpace\Site. Based on its default (1000) value and description we saw at for it this should be the one we need. But quick test will show us that increasing it doesn’t work for described problem. OK, maybe we just forgot to perform IIS reset which is necessary for web application to pick up the settings? Nope, IIS reset is necessary but this doesn’t help us to increase this limit.

Next thing which we may look at is OOBReports.xml file in the same location as aforementioned web.config file. It also do contain RowLimitRecordCount value which is actually controls the returned rows limit for Process Instances report (and judging by its name of other OOB reports too). And yes IIS reset is required for this change to take an effect. You may easily make sure that the same setting in web.config file controls the limit for custom reports if you quickly create custom report (you may be unoriginal and simply create Process Instances reports using Report Designer) and test this. You will be able to see the same message on a slightly different custom report layout and verify that this limit is controlled by setting in web.config file:


Other interesting thing which may be adjusted by editing OOBReports.xml file is whether deleted process instances should be included in reports. With regards to this setting you may adjust global default value for “IncludeDeletedStatus“, and also enable or disable the users capability to adjust this setting via the User Interface by changing the”DisableUserSetting” to False or True.

“Err and err and err again but less and less and less”

The quote in the title of this post is from one of the recent episodes of Numberophile YouTube channel, and I really like this quote, so decided to jot it down here:

“The road to wisdom? Well it’s plain and simple  to express err and err and err again but less and less and less”

Piet Hein

The video I mentioned features Don Knuth (author of “The Art of Computer Programming” and father of the analysis of algorithms) speaking about the Dragon Curve, superellipse  and learning from his mistakes, here it is:

Brave New World by Aldous Huxley

Shortly before the end of 2014 I finished listening to “Brave New World” by Aldous Huxley. This was unabridged version of classic piece of British literature in audio book format narrated by Michael York.


I first discover this book some time ago when listening to recordings of “Science-Fiction and Politics” class by Courtney Brown which he did at  Emory University, which is available in iTunes Podcasts if you interested to listen it too. This is amazing class where they took a list of some good science fiction books as a reading assignments for a class and during the classes trying to look at these books from the angle of politics, changes in society and how those may be relevant to real world politics and changes. At the end of the day most of good science-fiction books depict very different societies, where world either changed by technology or globally changed in some other way and this gives a lot of space for questions such as how big changes are brought about and executed, how people react and adapt to them etc. Very interesting approach. Another book from that class which made it to my “To read list” is a 1977 post-apocalyptic science fiction novel by Larry Niven and Jerry Pournelle “Lucifer’s Hammer”, though it was just briefly mentioned in this course if I’m not mistaken.

Anyway I just wanted to write a few words about Brave New World, not in support of “need to share culture” (one which replaced “need to know culture” these days), but rather in support of habit to reflect on what you consume (read, watch, listened to) :) To my non professional view this book written in 1931 very acutely reflects on fear of two things: consumerism and prosperity brought about by technological revolution plus dictatorship/total control, probably loss of soul and awareness that technology only will never solve humanity problems also. These two things (consumerism plus total control over society) paired together in this book to present us scary picture of society which offers perfect stability at expense of such things as art, freedom and even true science, by conditioning people into perfect crank of consumer society. Non consumption and everything non generating new demand are enemies of the new society. Sex and Soma (drug which keeps people happy) are built in into depicted society as things to be consumed massively and in an unrestrained way and necessary to maintain stability of the system.

This is a strong book about somewhat scary things, but as it presents us with very big picture (edifice of new system/society), this somewhat offset scariness of the picture. In a way books about real, commonplace bad things of everyday life produce stronger feeling of fear/gloom as they don’t hide this “everyday/commonplace dark side of our lives” behind any grand things or ideas showing that bad things just there without any particular reason and justification. It seems that we live in a world much closer to one depicted by this book, but do not think that it is scary. Author who lived in a moment of transition and early days of consumerism culture, in the presence of some totalitarian regimes was capable to draw a more vivid picture of these two things paired together and went wrong. As we somewhat moving in the similar direction embracing consumerism and giving up on religion, search of meaning and some other things as a society, we, at the same time, became less aware about dangers of this direction. The questions such as: “How bad the deceiving shine and prosperity may be upon a closer look? Do we really need just stability and prosperity no matter the price? How much of personal freedom could be sacrificed for prosperity and stability?” are still relevant anyway, since the time of Hobbes “Leviathan” we still trying to figure out how the state and society should be arranged and how the way we organize things on a large scale may be reconciled with the way individual man wants or tries to organize his life.

Anyway “Brave New World” is a book which most likely make you think about interesting questions which written masterfully, and it means that it meet main criteria of a good book.