How to redirect HTTP to HTTPS in IIS

Redirect are very common for web servers for most if not all websites these days.  This post I am using the URL Rewrite, if your server does not have already you need to download URL Rewrite extension which works With IIS 7, IIS 7.5, IIS 8, IIS 8.5, IIS 10.  Note.  If you already have the URL Rewrite you can skip to the section Adding Redirect Rule

Installation of URL Rewrite:

You can download directly from this link: https://www.iis.net/downloads/microsoft/url-rewrite

If you already have the Web Platform Installer, you can double click and find it there, under your web server>Sites>Select site>on the right-side panel you will see Management section

To start the installation double click on the URL Rewrite and click Install

Read the terms then click on I Accept

If everything goes well you should see, successfully installed, click Finish
you should see the URL Rewrite, if you don’t close the IIS Manager and re-open it.

Adding Redirect Rule:

Double click on the URL Rewrite for the site you want to redirect

Add your rules here, which fits your needs you may need more than one rules

I am going to create a rule to redirect HTTP to HTTPS:

Click Add Rules(s)
Then click on Blank rule (for Inbound rules)

Fill in the Name and other options shown in the screenshot, then expand the Conditions and click Add

This condition will check if user type’s https, then this rule will be ignored, so it avoids the loop

Nothing set on the server variables, unless you needed in some special case, you can add it, Next, we want to set up the redirect
https://{HTTP_HOST}/{R:1}

https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/url-rewrite-module-configuration-reference

Your Rule should look something like this if you open your web.config file:
        <rewrite>
            <rules>
                <rule name=”http to https redirect” stopProcessing=”true”>
                    <match url=”(.*)” />
                    <conditions logicalGrouping=”MatchAny”>
                        <add input=”{HTTPS}” pattern=”^OFF$” />
                    </conditions>
                    <action type=”Redirect” url=”https://{HTTP_HOST}/{R:1}” />
                </rule>
            </rules>
        </rewrite>

If you have issues make sure to check following:

  • Make sure your webserver firewall ports 80 and 443 are opened
  • You may need to restart the IIS service for rule to take effect, also make your local cache is cleared for your browser.
  • Double-check the pattern of your rule make sure it’s correctly typed, not a typo

That’s it



How to delete old VM from Hyper-V Cluster

Hyper-V cluster is a very common business network uses, which allows system admin to do system updates, without having any downtime. There are times when VM (Virtual Machine) are created for a test or just got upgraded and left to be deleted later on. Cleaning up old VM will free up the storage space. In this post I will have steps on deleting VM from Hyper-V cluster, before deleting, check the location of the VM because deleting from the Cluster server, will not free up the storage, you will need to delete it manually. You can see the location of the VM by going to settings of the VM and select the Disk, it will display full path where your VM disk is stored.

Open Failover Cluster Manager, then click on Roles, you should see list of VM’s, select the one you want to delete, then right on it and select Remove.

You will get confirmation message, make sure it’s the correct VM, then click Yes, The VM will be removed from the Cluster.

Then go to Hyper-V host where VM was running from, so you can remove from list

Confirmation are you sure you want to delete, if it’s correct VM you are deleting click Delete.

Now the VM is deleted from Cluster and remove from Hyper-V host, it’s time to delete the VM disk, by going to the location you looked at before you deleted the VM. That should give you back the storage space. That’s it, you get an error check the windows log or application log, it will give you more info.



How to restore deleted VM from Cluster

By mistaken you have deleted good VM and if you still have the VM disk, you can still bring it back online. As long as VM disk is not deleted from the Hyper-V it would be a very easy restore. Option 1 if you have not deleted VM from Hyper-V if you have deleted from Hyper-V follow option 2 after selecting VM from the Cluster Role.

Option 1

Open Failover Cluster Manager

Right click on the Roles>choose Configure Role …


Then you may get this default message: click next

Select the Virtual Machine, then click Next

Then you will see your deleted VM here: select it and click Next

If you don’t see the VM go to Option 2

Confirmation, Click Next

If everything goes well you should see success message with summary, if you want to see details click on View Report or click Finish.

Options 2

If you deleted VM and removed the Hyper-V host then you not see here, then you will need to add VM as new and use the same Disk

Adding new VM to Cluster with existing disk

Select the Cluster node (Hyper-V host), then click ok

Then you may see the New Virtual Machine Wizard, click Next

Then the VM to whatever you like, then click Next

Select the Generation of the VM:

Then set Memory and click Next

Select networking from list, then click Next

At this screen you will select the use an existing virtual hard disk, then click Next

You should see the Summary of new VM, if everything is good, click Finish

If everything goes well, you should see the Success message, click View Report for details or click Finish

That’s it, you should see your recovered VM back in the Cluster



How to install Ubuntu 18.04 Desktop

How to install Ubuntu 18.04 Desktop fresh using Hyper-V manager on Windows 10 Pro to Quick Create. There are many ways to install it, this process is very simple, you could do manual, which requires you to download the Ubuntu 18.04 image, then go through the process of installation. This will give you options to use your Ubuntu virtual desktop and get a feel of Linux system, when not in use, turn it off, so it goes not take resources of your system.

Open your Hyper-V Manger

Right click on Hyper-V host and choose Quick Create …

Then you will get option to select the Operating system, choose Ubuntu 18.04 LTS, and click Craete Virtual Machine. If you want to rename your VM, you could click on More options or you can rename later.

Then it will go through downloading the Ubuntu 18.04 LTS image, depending on your internet speed it may take awhile.

Then it will go through the automatic process of creating VM:

  • Verifying image
  • Extracting disk from an image archive
  • Creating a Hard drive
  • Virtual machine create successfully

Then you should see option to connect to your new Ubuntu 18.04 Desktop, click Connect

Click on Power button or Start to turn on your Ubuntu 18.04 server

You should see starting and then Welcome screen. Select your Language then click Continue

Select Keyboard layout, then click Continue

Select your Timezone, then click Continue

Fill in the login info, this would be admin account to login to your server, then click Continue

Then it will go through the System configuration automatically

Then you should see login screen enter your user/password created earlier

You should see your New Ubuntu 18.04 Desktop, it gives you few tips on What’s new in Ubuntu, go though and start using your Ubuntu Virtual desktop.

You can start using your Ubuntu 18.04 virtual desktop, see tips and tricks of common things you may find helpful, if this is your first time use of Ubuntu system.

Tips and Tricks:

Remove icon from favorites

Just right click icon you want to remove and choose Remove from Favorites

Opened applications

You will see little dot next to the application, you tell you that application is open.

More than one Application open

You will see more than one little dots, if you click on it, it will give you thumb nail view of and you will be able to switch it or close the application.

To see all opened Applications

Click on the Activities and it will give you thumbnail view of all opened applications, you can switch to it, or close it by click on X.

To see Applications

You can click on 9 dotted icon bottom left hand side, you will see all application or Frequent used

  • Software – where you can install new applications
  • Software & Updates – Where you can install updates and third-part software options
  • Startup Application – gives you list of application at start of your Ubuntu system
  • Settings – list of all settings like control panel
  • Files – your documents or personal files
  • Rhythmbox – is default music player

Shutdown Ubuntu Virtual Machine

Click on the Arrow on top left, you will see Power icon, if you want to just lock it, click on Lock icon.

When you click on Power icon it will give you option to Restart/Power off or cancel

Change User info

If you need to change user name or any setting, click on the Arrow next to your user name it will give you option to make changes

Change default applications

Click on Settings>Default Applications>Then change it to what you like



How to fix iDRAC6 communication Failure

How to fix the Dell PowerEdge server error “iDRAC6 communication Failure” and maybe get “power required may exceed PSU wattage” on the Dell PowerEdge server. Server internal fans running full speed, but everything else is normal storage, networking, CPU, Hard etc… Very strange, not reported any issue what so ever. Restarting server did not fix the issue. Looked at some blogs saying need to change iDRAC card, replace mother board, etc… It may be in your case if you have anything internal failed component.

Here are some screen shots of the error message I seen.

Firmware version 12.10.1-0001
iDRAC6 Communication Failure, Power required my exceed PSU wattage

After the firmware upgrade, you may see the iDRAC6 Communication Failure message. Link to download the firmware for iDRAC DELL PERC H700 Integrated firmware release 12.10.7-0001 https://www.dell.com/support/home/us/en/04/drivers/driversdetails?driverid=9fvj2

Process to fix the error message:

  • Turn off the server and unplug the power cords
  • Press and hold the Power button for 30 sec.
  • Then Plug back the Power cords
  • Wait for 30 sec.
  • Then Turn the server on
Upgraded the Firmware to 12.10.7-0001

Hope it help others out there, please use this guide at your own risk, if you are getting any internal component failed this may not fix your issues and restarting server without fixing component may cause more issues.