Importing a BACPAC to SQL Server

We previously looked at Create a backup for Azure SQL Server and in today’s post we are going to address how to look at that data by restoring or importing it to a local SQL Server.

To start, open SQL Server Management Studio (SSMS) and connect to a local instance of SQL Server. Right-click on the instance name and select Import Data-tier Application.


Simply click Next to go back the welcome screen of the import wizard.


Click browse and locate the BACPAC file on your local computer. Click Next.


Alternately, change the radio button to Import from Windows Azure and click Connect. You will be prompted to enter your storage account name and access key and then locate the BACPAC in your storage account. This will be downloaded as part of the import process to a temporary directory that can also be specified in the wizard.

On the database settings page of the wizard the database name, data file storage path and log file storage paths can be modified. The default locations for the data and log files will be pulled from the model database. Click Next.


Click Finish on the Summary page to being the import.


Each step and the status of the operation will be displayed. Assuming all green check marks click Close on the wizard. If there are any errors click the link in the Result column to see the details behind the failure. There should also be a new database in the SQL Server object explorer carrying the same name specified on the Database Settings page of the import wizard.


This satisfies the full set of requirements given by the customer:

  • Full backup of the data, archived monthly for 10 years – this can be stored in Azure blob storage and/or downloaded and stored locally
  • Ability to restore the archive at any time – a BACPAC can be imported to Azure SQL Database or to a local SQL Server
  • Maintain data access should the customer decide to no longer leverage Azure SQL Database – BACPAC files can be imported to a local SQL Server instance

Create a backup for Azure SQL Database

Azure SQL Database is a managed database platform as a service (Paas) offering available from Microsoft in the Azure cloud. One of the advantages to Azure SQL Database is all the file management, server maintenance and backups are taken care of automatically. Point in time recovery is built directly into the service. The amount of time a user can go back and perform a point in time restore depends on the service tier selected.

Creating the BACPAC

To start, open a web browser and access the Azure portal ( After signing in navigate to the SQL Databases section and select the database you want to archive.


On the overview page click the Export button near the top of the page.


On the resulting page name the BACPAC. Select the subscription and storage location where the BACPAC file will be saved. Enter the credentials that will be used to access the Azure SQL Server. Click OK at the bottom of the pane and the export process will begin in the background.


If you don’t already have a storage, you can configure one. Go to All resources, Add a new resource and search for Storage account - blob, file, table, queue. Be careful: the name of the storage is lower case.


Then in your new storage you have to create a container. You can create a container also in the Export process.

Under Activity log you can see the status of the export.


When the process is finished, in your storage you have to file under Blobs, ready to download it.

This file is a zip file and contains the structure and data of your database. Now you can delete the storage on Azure (it costs money).

How to reset lost SA password in SQL Express


If you ever find yourself in a situation where you need to reset the sa password on a SQL Express instance then you are not alone. I recently inherited a PC from a previous developer that already had SQL Express installed. This normally wouldn’t be a bad thing, except in this case it was not setup in mixed mode and my logged in account had no sysadmin rights on the instance.

In this article I hope to enlighten you as to how to reset the sa password in SQL Express without having any sort of administrator rights to the SQL instance.

You will need to be somewhat comfortable with editing the registry, starting and stopping windows services and working with a command prompt.

Steps to SQL Express sysadmin access

In order to gain sysadmin access to the SQL instance there were a few things that I needed to accomplish. Here is the basic goals I needed to achieve:

  • Change the login method from Windows Authentication to Mixed mode
  • Enable the sa user account
  • Reset the password to the sa user account

Doesn’t seem like that daunting of a list does it? I didn’t think so either.

Change the login method

In order to change the login method I had to change a registry setting. Why, you ask? Because, I say, we don’t have sysadmin rights so we can’t just change the database properties using SSMS.

  • Open the registry editor
  • Navigate to…
             \Microsoft SQL Server
  • Change the value of LoginMode from 1 to 2
  • Close the registry editor

One thing to note is I had a few different options under the “Microsoft SQL Server” branch so you may need to take an educated guess if yours is different.

Enable the sa user account and reset its password

I lumped these two into one section because the commands for them are entered at the same place.

  1. Open the Services applet in the Control Panel
  2. Find the “SQL Server (SQLEXPRESS)” entry and open its properties
  3. Stop the service
  4. Enter “-m” into the “Start parameters” field
  5. Start the service
  6. Open a Command Prompt
  7. Enter the command:

    Be sure to change PC_NAME to whatever your PC name is or you will get a big long message saying you messed up.

  8. At the next prompts enter the following commands:
    1> alter login sa enable
    2> go
    1> sp_password NULL,'new_password','sa'
    2> go
    1> quit
  9. Stop the “SQL Server (SQLEXPRESS)” service
  10. Remove the “-m” from the Start parameters field
  11. Start the service

At this point you should be able to login to SSMS using the sa user account and the new password you gave it.

Windows Live Writer For Windows 8.1

Windows Live Writer, developed by Microsoft, is a desktop blog-publishing application that is part of the Windows Live range of products. It features WYSIWYG authoring, photo-publishing and map-publishing functionality, and is currently compatible with Windows Live Spaces, SharePoint blogs, Blogger, LiveJournal, TypePad, WordPress, Telligent Community,, JournalHome, the MetaWeblog API, the Movable Type API, Blogengine, Squarespace, and all blogs that support Really Simple Discovery.

Windows Live Writer introduces the Provider Customization API that enables both rich customization of Windows Live Writer's behavior as well as the opportunity to add new functionality to the product. Currently Windows Live Spaces, WordPress, and TypePad have all taken advantage of this API to expose additional service-specific features within Windows Live Writer.

Windows Live Writer is currently available in 48 different languages.

wlsetup-web.rar (494.3KB)

How to Send Email Using Telnet

Sending emails with Telnet can be very easy if you know how to do it. In this article, you'll use SMTP mail Server to send email.

900px-Send-Email-Using-Telnet-Step-1-Version-2Open the cmd prompt. To open the command window, go to Start-> Run. Or press win key + R, type "cmd," and click OK.




900px-Send-Email-Using-Telnet-Step-2-Version-2Ping the server. Type "telnet 25" where "" is the name of the smtp server of your email provider (such as and 25 is the port number used by the SMTP service. (This number can be found by checking your account info in the program you normally use for email.) After you enter the above command you should receive a reply like "Trying, Connected to".

900px-Send-Email-Using-Telnet-Step-3-Version-2Specify the domain you're using to send mail. To specify the domain, type in the below command:

  • HELO (use your fully qualified domain name here).
  • You should receive a reply like: "250 Hello pleased to meet you".

900px-Send-Email-Using-Telnet-Step-4Enter your email address. Enter a space after the colon (:), and enter your email address as follows:

  • This should give you a message ending with "250 ...Sender OK".

900px-Send-Email-Using-Telnet-Step-5Enter the email address of the recipient. Type in the below command:

  • RCPT TO:
  • Note that you can enter more addresses if you intend to email more than one person.
  • You should see a message ending with "250 ...Recipient OK".


900px-Send-Email-Using-Telnet-Step-6-Version-2Compose your message. To start writing, type DATA and press Enter.

  • On the next line, type "SUBJECT: [your subject here]" and press Enter twice.
  • Continue typing your message.
  • To end your message, put a single period (.) on a line by itself, and press Enter.
  • You should see something saying "Message accepted for delivery."


900px-Send-Email-Using-Telnet-Step-7-Version-2Exit telnet. Type QUIT to exit.

Problems with partitions?

Partition Logic is a free hard disk partitioning and data management tool. It can create, delete, erase, format, defragment, resize, copy, and move partitions and modify their attributes. It can copy entire hard disks from one to another.

Partition Logic is free software, available under the terms of the GNU General Public License. It is based on the Visopsys operating system. It boots from a CD or floppy disk and runs as a standalone system, independent of your regular operating system.

Partition Logic is intended to become a free alternative to such commercial programs as Partition Magic, Drive Image, and Norton Ghost.


Partition Logic supports most basic PC hardware without any additional work or configuration.  It has very modest (by today’s standards) requirements:

  • Pentium-class or better x86 processor.  Supports all modern Intel x86 and AMD processors.
  • 32 megabytes RAM memory (16 megabytes if operating in text mode).
  • IDE (ATA) or SATA hard disks, or USB disks for partitioning.
  • IDE (ATAPI) or SATA CD-ROM drive, if booting from the CD version.
  • Standard PC floppy disk, if booting from the floppy disk version.
  • For graphics mode, a VESA 2-compatible graphics card with linear framebuffer support.
  • USB or PS/2-syle keyboard.
  • USB or PS/2-style mouse, if operating in graphics mode.


Partition logic has the following limitations:

  • No hardware support for non-USB SCSI hard disks
  • No support for Sun or BSD disk labels.
  • Cannot format partitions as NTFS or EXT3.
  • Cannot resize FAT or EXT filesystems.

Download (3,5MB)

CodeColorizer: Free Tool to Colorize Code in Html for Windows Live Writer


  • Just copy the file in the zip file to the Windows Live Plugin folder, typically C:\Program Files\Windows Live\Writer\Plugins
  • Open Windows Live Writer
  • You can launch the plugin by using the Menu Insert->Colorized Code, or use the Insert Colorized Code... in the Insert list in the right hand side panel
  • Select the right language, and now you can write the code, paste it into the window.
  • When you are done just click OK. and the right HTML will be inserted in your blog (37.7KB)

How to generate a SHA256 certificate and how to install SHA256 certificate in IIS

  1. Download and install OpenSSL from Shining Light. while installing please remember the path (Here my installation path is c:\OpenSSL-Win32)
  2. Create a folder in any location (My folder location is C:\OpenSSL)
  3. Open command prompt[cmd] exicute the below given command.
    set OPENSSL_CONF=c:\OpenSSL-Win32\bin\openssl.cfg
  4. Generate your Certificate request (CSR), specifying an SHA256 signature hash . Execute the below given command.[point in to the OpenSSL installation folder\bin (C:\OpenSSL-Win32\bin)]
    openssl req -nodes -sha256 -newkey rsa:2048 -keyout C:\OpenSSL\PrivateKey.key -out C:\OpenSSL\CertificateRequest.csr
  5. You’ll be prompted for a few certificate fields , enter those feilds as they come up.
  6. This will generate two files – 1) PrivateKey.key (which contains the un-encrypted version of your private key – protect this file, as somebody who obtains it along with your signed public key can impersonate you) 2) CertificateRequest.csr (your certificate signing request, which is not sensitive).
  7. Just check what hash algorithm is currently used, execute this below given command
    certutil -getreg ca\csp\CNGHashAlgorithm
    if this returns SHA256, skip to step 9.
  8. By default the above should return SHA1. Run this below given command to configure the CA to use SHA256 for CNG hashes.
    certutil -setreg ca\csp\CNGHashAlgorithm SHA256.
  9. Restart Certificate Services:
    net stop CertSvc && net start CertSvc
  10. Execute the steps no 7 and make sure that, the current HashAlgorithm is SHA256 .
  11. Go to your bowser, open http://localhost/CertSrv -> Click on Request a certificate
  12. ssl-sha256-1
  13. Then Click on Advanced certificate request.ssl-sha256-2
  14. Then Click on the Second link as given below.ssl-sha256-3
  15. Go to the folder where the CertificateRequest.csr is located [C:\OpenSSL]. Open the file CertificateRequest.csr in a notepad and copy the encoded value.
  16. Go back to the browser, paste your copied encoded values in to the Base-64-encoded certificate request as given below.ssl-sha256-4
    then click on submit.
  17. Click on Base 64 encoded option, then click on Download certificate link. It will download your .cer file [I am saving this CertNew.cer in C:\OpenSSL].ssl-sha256-5
  18. Copy your PrivateKey.key and CertNew.cer [from C:\OpenSSL] to OpenSSL installation folder\bin [C:\OpenSSL-Win32\bin]
  19. Open your Command Prompt [run->cmd] execute the below given script.[point in to the OpenSSL-Win32 installation folder\bin (C:\OpenSSL-Win32\bin)]
    openssl pkcs12 -inkey PrivateKey.key -in CertNew.cer -export -out CertNew.pfx
  20. Open your IIS[Run->inetmgr],go to the server certificates option as given below.ssl-sha256-6
  21. Click on the Import option as given below.-> select the CertNew.pfx file from the location where we created [C:\OpenSSL-Win32\bin\CerNew.pfx].ssl-sha256-8

FreeRDP HTML5 proxy on Windows

FreeRDP-WebConnect is an open source HTML5 proxy that provides web access to any Windows server and workstation using RDP. The result is amazing, especially considering that no native client is required, just a plain simple web browser!

Platform support

HTML5 has came a long way in the last few years, with any major web browser (including mobile platforms) supporting WebSockets, the underlying communication mechanism employed by FreeRDP-WebConnect.

Here’s a list of supported desktop and mobile browsers:

  • FireFox >= 11.0
  • Chrome >= 16.0
  • Internet Explorer >= 10
  • Safari >= 6
  • Opera >= 12.10
  • Safari Mobile >= 6
  • Android Browser >= 4.4

Supported client desktop OSs:

Windows, OS X, Linux

The FreeRDP-WebConnect service itself can be installed on most recent Linux distributions and on every x86 and x64 Windows versions starting with Windows Server 2008:

  • Windows Server 2008 / Windows Vista
  • Windows Server 2008 R2 / Hyper-V Server 2008 R2 / Windows 7
  • Windows Server 2012 / Hyper-V Server 2012 / Windows 8
  • Windows Server 2012 R2 / Hyper-V Server 2012 R2 / Windows 8.1

How to install FreeRDP-WebConnect on Windows

The installation on Windows is really easy. To begin with, download the installer from their website and run it:


Accept the license, select the installation type and optionally change the install location:


Next comes the HTTP and HTTPS configuration. You can just accept the defaults and go on with “Next” or replace the options to match your environment. Make sure to choose ports not used by other services. The installer will create a self signed certificate for HTTPS, no need to worry about it. Windows firewall rules are also automatically created if enabled.


The OpenStack settings are required only if you intend to use this service with OpenStack, otherwise you can skip them. Authentication URL, tenant name, username and password can be retrieved from your OpenStack deployment, while the Hyper-V host username and password are required to connect to RDP consoles and can be either local or domain credentials.


We’re done with the configuration, press “Next” and the the installer will complete the installation.


Once done, point your browser to “http://localhost:8000″ (or a different port if you changed it above) and you’ll see the initial connection screen (using Chrome on OS X in this example, but any of the options listed above is also valid):


Set the host, username and password and click connect:


That was it, connected! A native client will still have an edge in terms of performance, but for a lot of scenarios a pure web client enables an amazing whole lot of new possibilities!

Integration with OpenStack

We integrated RDP support in Icehouse, on both Nova and Horizon. All you have to do to make it work is to specify the url of your FreeRDP-WebConnect service in the Hyper-V Nova compute nodes as detailed below and restart the nova-compute service. The Hyper-V Nova compute installer takes care of these settings as well of course!

Download the application

FreeRDPWebConnect_Beta.msi (6.4MB)

MDaemon Messaging Server (free)

MDaemon Messaging Server, email server software for Windows, is a trusted alternative to Microsoft Exchange or SBS. MDaemon mail server supports IMAP, SMTP, POP3, and ActiveSync protocols and delivers solid performance from its feature-rich and user-friendly design. 
  •  WorldClient (Web-Based Email)
  • MDaemon Remote Administration
  • WorldClient Instant Messenger
  • Microsoft Outlook Integration (Outlook Connector)
The free version has limited functionality.