Adding ASP.NET Features to IIS7.5

By default Windows 7 IIS is missing the asp.net features, shown above the IIS section in the control panel

The control panel is shown below with only the IIS options and Management options.

Adding ASP.NET Features in IIS 7.5

To add the asp.net features. Begin by opening the control panel and selecting from the Programs section the option Turn Windows features on and off.

Adding ASP.NET Features in IIS 7.5 Windows Features

Click on the checkbox for ASP.NET.

 

Adding ASP.NET Features in IIS 7.5 Windows Features add ASP.NET

There’s a dialogue window confirming that the amendment is taking place:

Please wait while Windows makes changes to features. This may take several minutes.

You may find that this takes a few minutes. Wait whilst the dialogue completes.

I have read that IIS is to be restarted for the change to show. However, for me it was sufficient to close the management window and reopen it once more.

 

Adding ASP.NET Features in IIS 7.5 Including ASP.NET

 

Whilst the control panel ASP.NET section is missing by default its easy to add it in, following the steps above beginning with the control panel.

 

Windows 10 Manually Checking for Windows Updates

Looking to update Windows 10 manually where can I find the Windows Update page?

Windows 10 Windows update: select settings

From the Windows home screen click on the Windows icon in the bottom left hand corner and then the Settings icon a little above.

Windows 10 Windows update: Windows settings

This view shows the main Windows Settings page. The section of interest is Update & Security, at the bottom. Click on it.

Windows 10 Windows update: Settings Windows update

On the left is a menu of options, including our item of interest, Windows Update, listed at the top. If Windows Update isn’t showing select it from this menu.

Highlighted with a grey background is the manual trigger for the Windows Updates. Click on this to begin a manual check of available updates.

Windows 10 Windows update: check for updates

The page changes to show the update status. Initially a check is made for available updates.

 

web.config Redirect non-www to www

That often looked for website redirect from the non-www version of the website URL, address, to the www version.

In this case the redirect is for a Windows hosted website, using the web.config file to set the redirect rules.

I wish to avoid adding the redirect within the website coding. By taking advantage of the redirect rules within the web.config file. This will make them readily available and can be edited without recompiling the website code.

Access your website either using FTP or the editor/manager within the housing website control panel.

The file to be edited is located at the root of the website. This may be a directory down. Check if you have a directory such as public_html.

It’s easier to edit the content of the web.config file of is laid out correctly and colour coded. An HTML editor will make your life easier when editing.

Shown below is the code to add the redirect of the non-www address to www to be added to the web.config asp.net website configuration file:

<rewrite>    
    <rules> 
        <rule name="Canonical" stopProcessing="true"> <match url=".*" /> 
            <conditions> 
                <add input="{HTTP_HOST}" negate="true" pattern="^www\.([.a-zA-Z0-9]+)$" /> 
            </conditions> 
            <action type="Redirect" url="http://www.{HTTP_HOST}/{R:0}" redirectType="Permanent" /> 
        </rule> 
</rewrite>

The above is to be added within the section <system.webserver>

As as a bonus below is the HTTPS version too!

<rewrite>    
    <rules> 
        <rule name="Redirect to HTTPS" stopProcessing="true"> 
            <match url="(.*)" /> 
            <conditions> 
                <add input="{HTTPS}" pattern="^OFF$" /> 
            </conditions> 
            <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" /> 
        </rule> 
    </rules> 
</rewrite>

Putting this all together gives:

<rewrite>    
    <rules> 
        <rule name="Canonical" stopProcessing="true"> <match url=".*" /> 
            <conditions> 
                <add input="{HTTP_HOST}" negate="true" pattern="^www\.([.a-zA-Z0-9]+)$" /> 
            </conditions> 
            <action type="Redirect" url="http://www.{HTTP_HOST}/{R:0}" redirectType="Permanent" /> 
        </rule> 
        <rule name="Redirect to HTTPS" stopProcessing="true"> 
            <match url="(.*)" /> 
            <conditions> 
                <add input="{HTTPS}" pattern="^OFF$" /> 
            </conditions> 
            <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" /> 
        </rule> 
    </rules> 
</rewrite>    

Technically it’s a 301 or 302 redirect. Looking at the code above it can be seen that I’ve used the redirectType parameter value of permanent showing the redirect to be of type 301. web.config rewrite rules to permanently redirect non-www to www.

Change Windows 2008 User Password Lost Current Password

Having lost the current password for a Windows 2008 server user account. How do I change the password?

If I follow the control panel link to the user and look to reset the password, a part of the dialogue requires entry of the current password. Which I didn’t have!

Its possible to get around this requirement from a command prompt.

Right click on command prompt, from the menu, and select to run as administrator

Enter

net user username *

When asked, enter the new password, and re enter for confirmation.

Obliged to confirm that the password change is correct and the anticipated value has been entered I once more tried logging in with a remote desktop session from another computer.

Using the command prompt as opposed to the user control panel I was able to reset a user password without the knowledge of the current password.

 

Install ExpressMaint SQL Backup utility

ExpressMaint is a utility which may be used to automate the backup of SQL Server databases.

It can be used to create and save a backup of each of the databases within an SQL Server. Better still it can be set to age the files, deleting all those older than, say, a month.

The ExpressMaint project home page is here: https://expressmaint.codeplex.com/

Download a copy of the zip file ExpressMaint.zip. Extract the ExpressMaint.exe file contained within to your scripts directory.

I’ll assume that the exe file has been added to the folder as: z:\ExpressMaint.exe.

I use a batch file to call the exe file, passing the relevant parameters.

And I have created a backup directory for the databases at z:\backup.

The batch file for running ExpressMaint is located at: z:\expmaint.cmd.

Contents of which are given below

 "z:\expressmaint.exe" -S webserver\SQLserver -D ALL_USER -T DB -R "z:\dbBackup" -RU WEEKS -RV 4 -B "z:\dbBackup" -BU WEEKS -BV 4 -V -TO 20

In the above change the name of the server webserver and Sqlserver as appropriate.

shows example for individual database location

I created a scheduled task to run daily.

On Windows Server 2012 I found that expressmaint.exe wasn’t running as a scheduled task.

Searching for more information about the cause of the issue. I found this on stack exchange, which recommend using a later version of ExpressMaint:

I am actually using expressmaint with sql server 2012 express so u shouldn’t have any problems. make sure u use

https://expressmaint.codeplex.com/downloads/get/91612 which is version 2.0.0.1 and NOT 2.0.0.0

 

Stack Exchange article reference is:

http://dba.stackexchange.com/questions/24750/is-it-possible-to-use-expressmaint-with-sql-server-2012-express/120387

Following the referenced link and using that version of ExpressMaint worked.

Where’s the Windows 10 Control Panel?

Accessing the Control Panel in Windows 10 is one of those of course how obvious moments.

I found that the main control panel home page in Windows 10 was access by simply right clicking on the Windows logo at the bottom left hand corner of the screen.

Right click on the Windows logo to show a menu of admin related options.

Windows 10 open the control panel

The control panel is listed here amongst the other admin actions.

Where is the Windows 10 Services Control Panel?

In Windows 10 the Services control panel is to be found grouped on the Task Manager.

To access the services list begin by opening the Task Manager – right click on the Windows icon in the bottom left of the screen

Windows 10 open task manager

Clicking on Task Manager from this list opens the grouped Task Manager control panel.

Windows 10 task manager

Onto this panel has been grouped a number of the previously discrete individual views including the Services control panel.

Windows 10 task manager services

Click on the last tab to show the Services.

Taking Screenshots on Windows 10

Taking a screenshot of the display on a computer can be a great way to convey the configuration settings or an error message.

Preparing the article Install IIS on Windows 10 I was interested in taking screenshots of my progress through the various screens.

I looked at using the pnt scr key.The choices associated with this option are more limited. Having taken the screenshot it requires a document to paste into. I wished to be able to do a simple save to a jpg file. Further, its a simple screen capture, rather than the capture of a selected window or a rectangular area of the window.

I chose to use the  Snipping tool.

To start this I began typing the word snipping in the search box at the bottom left of the screen until the word snipping was presented as an option.

Using the snipping tool I found it convenient to select the New>Window option. I was then able to select from the open windows and click on capture.

Having captured the window, with a trigger delay if it helps, I saved the file for use.

The saved file is of a quality and file size greater than will be required on a website. A smaller file size is downloaded quicker making the page load faster giving happier website visitors and better search engine results.

I used the Gimp to edit my images, reducing the saved image quality. If I had more images to adjust them a program such as XnConvert may have been more appropriate.

Screenshots on Windows 10 continue to support the use of the prt scr key.

Install IIS on Windows 10

For testing and development it’s convenient to install IIS on a Windows computer. In this case Windows 10.

IIS is installed through the Windows features control panel.

To access the Windows features, begin by opening the control panel by right clicking on the Windows logo. From the control panel home select the Programs and then Turn Windows features on and off.

Or if you prefer type the name of the control panel appwiz.cpl into the search box and press enter.

This will open the first stage, the Programs and features control panel.

Windows 10 install IIS programs and features

Click on Turn Windows features on or off in the left hand menu column. This will open a popup showing the list of features available.

Windows 10 install IIS Windows features

From the list select entries pertaining to IIS.

Windows 10 install IIS Windows features IIS options

You may wish to select the outer element allowing it to populate a typical set of options.

Once done click on OK at the bottom

Windows 10 install IIS Windows features applying changes

The new additions will be added.

Windows 10 install IIS Windows features changes completed

Until all is installed.

Checkout your installation of IIS by navigating to http://localhost.

Windows10 install IIS localhost confirmation

 

web.config Redirect http to https

Windows server with IIS allows website redirects to be configured in the web.config file, located at the root of the website files directory.

I wished to add the following rule to redirect http web pages to https

<rule name="Redirect to HTTPS" stopProcessing="true">
  <match url="(.*)" />
    <conditions>
      <add input="{HTTPS}" pattern="^OFF$" />
    </conditions>
  <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
</rule>

The web.config file provides the main configuration and settings for asp.net server application framework and the website server.

The file is organised as a series of settings within a nested structure. Each item is wrapped within a less than and greater than pair.  Shown below is an example web.config file:

<?xml version="1.0"?>
<configuration>
   <system.web>
     .. existing text ..
     .. existing text ..
   </system.web>
   <system.webServer>
      <defaultDocument enabled="true">
         <files>      
            <clear/>              
            <add value="index.html"/>
            <add value="default.aspx/>
         </files>
      </defaultDocument>
   </system.webServer>
</configuration>

The rule is added to the rewrite section within the system.webserver section.

Open the web.config file with an HTML editor. I use Geany or Bluefish if using an Apple Mac.

Scroll down the file looking for the web.server section. It begins <system.webserver>.

If there are already redirect rules configured there’ll be a section for these. The wrappers for the rules begins:

<rewrite>
  <rules>

Its possible that rules have not previously been configured and will need to be added.

Shown below is the same basic web.config file with the redirect rules for http to https added:

<?xml version="1.0"?>
<configuration>
   <system.web>
     .. existing text ..
     .. existing text ..
   </system.web>
   <system.webServer>
      <defaultDocument enabled="true">
         <files>      
            <clear/>              
            <add value="index.html"/>
            <add value="default.aspx/>
         </files>
      </defaultDocument>
      <rewrite>
        <rules>
          <rule name="Redirect to HTTPS" stopProcessing="true">
            <match url="(.*)" />
              <conditions>
                <add input="{HTTPS}" pattern="^OFF$" />
              </conditions>
            <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
          </rule>
        </rules>
      </rewrite>
   </system.webServer>
</configuration>

Wikipedia has a rather short entry for the web.config file.