How To Virtualization Windows

Use of SYSPREP to duplicate windows image with new SIDs

From past some time I am trying to create windows domain in home computer with bunch of VMs using Windows Server 2008 R2 for “educational” purposes Open-mouthed smile … my ultimate goal was to setup clustered windows system and have SQL Server in that environment. I want to lean about how SQL Server behaves in clustered systems and what are ups ‘n downs of any clustered system … like OS updates, SQL Server updates, SSIS – SSRS behavior in failover, system crashes etc … I mean you can always lean by reading but I think it gives better idea when you can actually test those theories on some kind of test system Nerd smile

So, by following few blogs, MSDN helps and forums … I was finally able to install and configure everything properly … I had working domain too … but when you try to setup windows cluster, it is recommended by MSFT to validate cluster before setting it up. Which basically runs bunch of tests like check all nodes, their hardware, their compatibility, storage system, network settings etc … and if any test fails then you have to fix that issue before setting up cluster. And if you are not too savvy about these items then it is really painful experience.

So when I tried to run this test .. it failed at one particular point where it validates system configuration. Unfortunately I don’t have screenshot of this error so I can’t show detailed message but it had something to do with system settings. I tried to look for this error and I was not able to find any definitive answer until I found an answer in stackoverflow which mentioned that it could be because of SIDs !

How To Installer

Creating Application Shortcut in Programs for Windows Installer Project

It has been while since I posted something. Actually I was on very long vacation Open-mouthed smile for almost 2 months and during that time all I did was eating, traveling, sleeping and eating again … and now it is ended and I am back .. I think I have gained few pounds… so (just like every year) this new year I have taken resolution to get back in shape (that’s a different story that right now I am in crisis to stay resolute Confused smile).

Ok, enough babbling … I am sure everyone is familiar with shortcuts created for an application when we install it. Usually these shortcuts are created inside Programs’ menu (aka Start menu) and Desktop … sometimes you even have options to create in quick launch menu too. Actually it is very easy to achieve this in Windows Installation project and in this post I am going to show just that …

First step is to create new Visual Studio Installer project and give it any name. Since I am very bad with names, I simply gave it “TestMSI”. Then I added one text file I had for another post and added it installation. If you don’t know how to create an installation project or add a file into installation project then read this old 101 post. Once that file is added, say I want to create a shortcut of this file on user’s desktop and start menu. To create a shortcut in Start menu, select “File System” in MSI project and select “User’s Program Menu”. When it is selected, right click in work area and select “Create New Shortcut”.


Importing Fixed Width file into database using SSIS package

Ok, few weeks back I posted how to create a fixed width file using SSIS for test purposes. Then after that I posted TSQL way to import it into database, and now today I am going to show how to import it using SSIS package… I have used same database (which I used to generate file) and same file (generated using SSIS package) for this demo because … well because I can Open-mouthed smile.

First step is to fire up VS 2010 with SSDT and create new SSIS project. And then select data flow task and drag it to control flow tab. Open up data flow task and select “flat file source” as source of data and drag it to data flow task work area. This will open up connection wizard which you will use to configure flat file source.



For those who don’t know what flat files are … they are just a txt or csv files. They could also be fixed position files. All of them uses some kind of row and column delimiter to separate data within them

How To Installer

Advance MSI creation … Part II

In First part of this How To I explained essential component required to manipulate MSI installation process and create funky installation process. In this part I will use that theory of 1st part and create an advance installation process which will do following steps as part of installation process …

1) Install a file at user selected location

2) Write a timestamp into that file

Under the hood this whole process actually includes more steps, this file is located into a temp folder from where this file will be copied to install directory and then I will write a timestamp to this file. And also I will remove that temp folder which was hosting this file originally.

Before anyone assumes that I am flippin’ genius or something and I have invented this whole thing, I would like to let you folks note that part of this post is based on MSDN post @ how to create custom actions in Installation projects. Rest of items are my ideas but believe me its not THAT difficult to make ‘em work Open-mouthed smile

How To SQL Server TSQL

Importing Fixed Position file into SQL Server

For any DBMS system (I know that it sounds redundant) data can come into variety of forms and formats .. say CSV, XML, another DBMS, tab limited file or fixed position file or any proprietary format (as long as you have data providers for them Open-mouthed smile). And most of connected DBMS systems have different approaches to import those kind of formats into database. One of that format is fixed position files, in many cases these finds of files gets generated by applications that uses flat file databases to store data.

In SQL Server there are three main ways to import these fixed position files into database. Using Bulk Insert tsql command, using BCP utility or using SSIS. In today’s post I will be showing way to import file using BULK INSERT. May be later on if I am feeling graceful, I will write about SSIS and BCP methods as well Open-mouthed smile. Ok, so for purposes of test, I have created a fixed position file using SSIS. If you don’t know how it is done is SSIS see this previous post for HOW TO create fixed width file in SSIS.

How To IIS

Use of SLL in IIS

I recently got curious about use of SSL in SSRS. I mean I know that it has an option to use secure HTTP but I have never used it. Because in all of the places where I have worked were either not interested in using SSL or just felt that it is too expensive to use and maintain ‘em.

So this weekend I decided to take matters in my hand and decided to start my journey to make SSRS use SSL Smile. And first step for me was to make IIS use SSL. I really don’t have expertise to explain how SSL works but it is basically process of exchanging information between server and client via certificates and then verifying that information to make sure that both server and client are really what they say that they are.

And as you know that these server certificates has to be signed by some kind of CA (certificate authorities) and they charge hefty amount of $$$ for these kind of certificates. But if you want to use your secure HTTP just for very limited userbase or want to test some SSL based features then IIS has a feature called “self-signed certificates” which basically allows users to create their own certificates to use !!


This whole process of generating self-signed certificate is very easy process. For that just open up IIS Manager and select “Server Certificates”. Open up that option and on right hand side there is a sidebar with bunch of different options. One of the option is “Create Self-Signed Certificate”, click on that option and it will open up a small window. This window will prompt to specify “user friendly” name for that certificate. And that it !! Once user friendly name is entered, it creates certificate for you … just like that …

How To IIS

Easy URL Rewrite in IIS

URL rewriting is a process of shortening URL of web pages and making them more user friendly. If you have been working with MVC then you probably already know what I am talking about. But what to do if your application is plain old Web application?  Having user friendly URL really simplifies things for end users. Imagine a product URL for your company is http://someCompany/Products/list/ProductName.aspx , which is definitely not helpful to customer who is trying to reach to that product page directly (only way probably is to create a link on some page). But with help of URL Rewrite you can shorten this URL to http://someCompany/Products/ProductName a user friendly URL, isn’t it ? Besides having good lookin’ URL another advantage is it hides actual directory structure from outside world.

In this post I am going to show how easy it can be to use this great little module.

First, if you don’t have this module it can be downloaded from IIS website or using Web PI (if you have downloaded Web PI before then chances are you already have it). Once it is installed, you will see it in IIS Manager (see screenshot below)