DbUp setting command timeout in PowerShell (ExecutionTimeout)

I needed to increase the command timeout in DbUp from the default 30s to 10min and all examples that I found were in C#.

The good news is that PowerShell support of .net is really good and I manage to even use a callback function:

$dbUp = [DbUp.DeployChanges]::To
$dbUp = [SqlServerExtensions]::SqlDatabase($dbUp, $constr)
$dbUp = [StandardExtensions]::WithScriptsFromFileSystem($dbUp, $scriptPath)

$dbUp.Configure({ param($c); $c.ScriptExecutor.ExecutionTimeoutSeconds = 10 * 60 }) # 10 min command timeout

$dbUp = [StandardExtensions]::LogToConsole($dbUp)
$upgradeResult = $dbUp.Build().PerformUpgrade()

If you want to use DbUp for database maintenance script automation check here.

Reference article with C# timeout setting solution here.

DbUp setting command timeout in PowerShell (ExecutionTimeout)

How to enable IIS Configuration Auditing with Command Line (tool)?

Eventvwr_iconIIS configuration auditing is a feature that would let you monitor the changes that are done to the IIS configuration store. It generates event messages (similar to those generated by enabling metabase auditing in the previous versions). It would display the configuration element which was changed, the user who initiated the change, and the original and the new value of the element.

If you do it on a single server ones – the UI will be the easiest choice:

  1. Open Event Viewer (Administrative Tools –> Event Viewer)
  2. Expand the “Application and Service Logs”
  3. Expand “Microsoft”, and expand “Windows”
  4. Expand “IIS-Configuration”, and right click on “Operational”, and choose “Enable Log”

For DevOps – the command line is:

wevtutil sl Microsoft-IIS-Configuration/Operational /e:true

Wevtutil.exe is a Microsoft tool for modifying the EventLog.

Have in mind that manual changes (with notepad for example) in the config files will not be detected and logged.


Nik Todorov

How to enable IIS Configuration Auditing with Command Line (tool)?

bootstrap, knockout.js, radio buttons group, can play nice and can be dynamic

I’ve tried to use knockout.js (KO) with bootstrap and I found that it will not work out of the box. The main reason – bootstrap will prevent the click events to go to knockoutjs.

I had two challenges:
1. How to notify KO about the click event without breaking bootstrap?
2. How to do KO data binding with the radio buttons?

After some investigation/googling the answer for challenge 1 became apparent – use custom bindings in knockoutjs: http://knockoutjs.com/documentation/custom-bindings.html

That solved the click event on the buttons.

The answer for number 2: How to use knockoutjs to create dynamically the items (buttons) in my bootstrap radio button group? – It was harder for me – All examples were with static/predefined radio buttons.

The solution came again from the KO documentation – I just did a careful modification of their example for the checkbox to a radio button.
I have the working example below in a gist extracted from my jsfiddle

The key code:

<div class="btn-group" data-toggle="buttons" data-bind="foreach: items">
    <label class="btn btn-primary">
    <input type="radio" name="options" data-bind="checkedValue: $data.id, bsChecked: $root.chosenItem" />
    <span data-bind="text: itemName"></span>

..and the full gist:


If you have any questions, feel free to use the comments section bellow.

Happy coding and let’s code the planet togeter! 🙂

bootstrap, knockout.js, radio buttons group, can play nice and can be dynamic

How to list the members of local Administrators group with windows command line

Some time savers for you:

If you need to list all members in ANY local windows group this is the command line:

net localgroup Administrators

If you need to list a domain group

net group MyGroupName /domain

if you need to see information for a domain user (includes is active and his groups):

net user MyUserName /domain



How to list the members of local Administrators group with windows command line

Visual Studio 2015, Mac OS and F12 (F11) not working

I’ve recently downloaded the new VisualStudio 2015 community edition on my MacBookPro and started enjoying all new features. I’m using Parallels virtual software to host my Windows 10.

Both Win 10 and VS2015 are a really nice piece of software to use, but I found one very annoying problem – F12 did not work. I assume that you are a software developer – you know how often we are using F12, and I needed to right-click -> find declaration a lot.

I knew that this is not VisualStudio problem and that most probably is some setting in my MacOS, so I’ve started digging.

First in MacOS:

under Settings > Keyboard > Keyboard > 
check "Use all F1,F2,etc. as standart function keys"


That disabled the usual Sound, brightness, etc. functionality on my Mac book pro but that’s OK with me – pressing fn +F1… will give me that back. This setting helped for most of the F keys but not for F11, F12.

After digging more, I found:

Settings > Keyboard > Shortcuts > 
uncheck: Show Desktop and Show Dashboard


unchecking them solved my problem.

Now all my windows working habits are usable in my OSX.

I hope this saves you time.

P.S. As you probably noticed this will work for any version of visual studio or any software that uses F11, F12.

Visual Studio 2015, Mac OS and F12 (F11) not working

Creating new IIS site and ERROR ( message:Failed to add duplicate collection element “yoursite”. )

If you executed a command line to create a new website in IIS8 and encountered: ERROR ( message:Failed to add duplicate collection element “yoursite”. ) this is what fixed in my case.

After executing:

C:\windows\system32\inetsrv\appcmd.exe add site /name:YourSite /id:12 /bindings:"http/*:8099:"  /physicalpath:E:\inetpub\yoursite

It errored out with the message above, and I thought that there is already a site with this name. Searing and googling and checking %windir%\system32\inetsrv\config\applicationHost.config I found nothing!

The problem was not the name it was the id!


So if you have duplicate id the error is the same as duplicate name.
EDIT: Change the id with some unused number and you are good to go.

I hope this saves you time!

Creating new IIS site and ERROR ( message:Failed to add duplicate collection element “yoursite”. )

msbuild cannot build visual studio setup projects – for real!

Screen Shot 2015-07-16 at 9.49.05 PMI had a funny experience today with msbuild and Visual Studio project type: setup package (vdproj).

In attempt to introduce a new solution to cruisecontrol.net (my clients choice, not mine) we encountered a situation when the build was green but no output media!

After digging more, I saw that the solution was building fine except the last project – the main setup project that we were expecting as result media. Checking the logs showed that all project build fine, but when msbuild hits the *.vdproj reports warning:

todo: add the warning here

In my book, this should have been an error… The problem was that I did not believe it! We had at least two other projects like this one, and they were building fine for a long time. Ignoring the common sense and the meaning of the warning I’ve started rather long googling exercise about this situation. All articles were pointing that we should use devenv.exe for vdproj type, but I still did not want to believe. How the hack my other two projects were good to go, but not this one?!?

Finally my rational side kicked off and my hunger to understand the big “Why?” kicked off, and I went to the basics.

Let see how the successful projects are build – and I was so sure that we are using msbuild for everything…

Checking the log revealed right away that the usual command line with msbuil.exe is missing…

You gotta love the job as a developer and in some cases as DevOps – it keeps you real and focused every day. It challenges your assumptions.

My favorite quote was proven true for a millionth time: “The computer will not do what you want, but what you are telling it to do!”

Checking more details for those particular successful project showed me that they are treated as special type of build, and our scripts were using the devenv.exe

I understand that it will be painful for you to build .vdproj type if your build server does not have installed Visual Studio – aka devenv is missing…

Note to myself: in case we move to ThoughtsWorks GO and we start using multiple agents on different servers that do not have devenv – what should be the best option for building?…
Please comment bellow if you have experience with this.

Thanks in advance,

msbuild cannot build visual studio setup projects – for real!