All posts by admin

Azure Set-AzureNetworkSecurityRule error

Today I was trying to add a rule to an existing NetworkSecurityGroup (NSG) on Azure. My existing setup has another rule I’m using to block outbound access to the Internet for the servers:

#Add a rule to a NSG to deny outbound Internet, effectively overriding the default "ALLOW INTERNET OUTBOUND" default rule
Get-AzureNetworkSecurityGroup -Name "DenyInternet_uswest" | Set-AzureNetworkSecurityRule -Name "DENY INTERNET OUTBOUND" -Type Outbound -Priority 4000 -Action Deny -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix 'INTERNET' -DestinationPortRange '*' -Protocol '*'

I wanted to add a rule allow access to this website:

#Add a rule to a NSG to allow access to website
Get-AzureNetworkSecurityGroup -Name "DenyInternet_uswest" | Set-AzureNetworkSecurityRule -Name 'ALLOW SYMSOLUTIONS TCP/80' -Type Outbound -Priority 2000 -Action Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '' -DestinationPortRange '80' -Protocol 'TCP'

Unfortunately, this failed with the following not-useful-as-all error message:

Set-AzureNetworkSecurityRule : <?xml
version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="">
<style>BODY { color: #000000; background-color: white; font-family: Verdana; margin-left: 0px; margin-top:
0px; } #content { margin-left: 30px; font-size: .70em; padding-bottom: 2em; } A:link { color: #336699; font-weight:
bold; text-decoration: underline; } A:visited { color: #6699cc; font-weight: bold; text-decoration: underline; }
A:active { color: #336699; font-weight: bold; text-decoration: underline; } .heading1 { background-color: #003366;
border-bottom: #336699 6px solid; color: #ffffff; font-family: Tahoma; font-size: 26px; font-weight: normal;margin:
0em 0em 10px -20px; padding-bottom: 8px; padding-left: 30px;padding-top: 16px;} pre { font-size:small;
background-color: #e5e5cc; padding: 5px; font-family: Courier New; margin-top: 0px; border: 1px #f0f0e0 solid;
white-space: pre-wrap; white-space: -pre-wrap; word-wrap: break-word; } table { border-collapse: collapse;
border-spacing: 0px; font-family: Verdana;} table th { border-right: 2px white solid; border-bottom: 2px white solid;
font-weight: bold; background-color: #cecf9c;} table td { border-right: 2px white solid; border-bottom: 2px white
solid; background-color: #e5e5cc;}</style>
<div id="content">
<p class="heading1">Service</p>
<p>Endpoint not found.</p>

At line:1 char:61
+ Get-AzureNetworkSecurityGroup -Name "DenyInternet_uswest" | Set-AzureNetworkSecu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Set-AzureNetworkSecurityRule], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Network.NetworkSecurityGroup.SetAzureNetworkSecurityRule

It turns out that you can’t have a / (slash) in the -Name parameter:

#Add a rule to a NSG to allow access to website
Get-AzureNetworkSecurityGroup -Name "DenyInternet_uswest" | Set-AzureNetworkSecurityRule -Name 'ALLOW SYMSOLUTIONS TCP80' -Type Outbound -Priority 2000 -Action Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '' -DestinationPortRange '80' -Protocol 'TCP'

Install .NET Framework 3.5 SP1 using PowerShell

Installing .NET Framework 3.5 SP1 on Windows Server 2012 R2 should be easier. Unlike normal role and feature additions the binaries are not installed during Windows installation. This is fine if your server can access the Internet, but if it can’t then the installation media is required. Installation media these days are ISO files, so why not make your life easy and mount it on the server? Thankfully Windows finally has the ability to do this natively without the use of a third party tool (my favourite is still SlySoft Virtual CloneDrive).

So, using the GUI one can follow Enable .NET Framework 3.5 by using the Add Roles and Features Wizard. That’s no fun though, so I found Enable .NET Framework 3.5 by using Windows PowerShell. It’s not quite there though, I’d like some more automation.

Here’s how I install .NET Framework 3.5 SP1 using PowerShell. It will mount the media, install the feature and then unmount the media without you doing anything.

Modify the $ISO variable as required to the location of your media:

#Specify the local path path or network share URI to the Windows Server 2012 R2 media
$ISO = "\\FILESERVER\Microsoft\Win2012\SW_DVD9_Windows_Svr_Std_and_DataCtr_2012_R2_64Bit_English_-4_MLF_X19-82891.ISO"

#Mount the ISO to an available drive letter
$imagehdl = Mount-DiskImage -ImagePath $ISO -Verbose -Passthru

#Find the drive letter that was assigned
$mntpoint = ($imagehdl | Get-Volume).DriveLetter

#Install .NET Framework 3.5 SP1
Import-Module ServerManager
Install-WindowsFeature Net-Framework-Core -Source "$($mntpoint):\sources\sxs"

Get-WindowsFeature -name NET-Framework-Core | Select Name,Installed

#Dismount the ISO, we're done
Dismount-DiskImage -InputObject $imagehdl

Upgrading a HP Compaq nw8440 Mobile Workstation to Windows 7 64-bit


I recently had to reinstall Windows on a client’s machine as it had crawled to halt as operating systems tends to do as the sludge builds up. The machine was running XP Professional. The client’s opinions of Windows Vista were less that favourable given its reputation in the media and more importantly on the street. He suggested reinstalling XP, but I figured Windows 7 would be a good choice. So far I have had good success with Windows 7, even on older hardware. It’s what Vista should have been! Turns out the HP Compaq nw8440 Mobile Workstation he owned was quite the powerhouse . It’s no Core i3/5/7 but it did have a Core 2 Duo T7400 which still has some life in it. When he bought this machine he paid a significant amount of money so I figured it would be worth reviewing potential hardware upgrades if I was going to go through the steps of installing a new O/S.

Hardware upgrades

I chose to upgrade the existing 80GB hard drive to a new faster 320GB (Seagate Momentus 7200.4 320 GB 7200 rpm 16MB Buffer Serial ATA 2.5” Hard Drive) drive. Although he didn’t need all that space, I also bought a USB enclosure to drop his old drive into so there was no chance of him losing data. This is my preferred upgrade path for O/S reinstalls, this way I don’t have to make sure I’ve got everything before wiping the drive! I also upgraded the RAM from the existing 2GB to 4GB using a Kingston HyperX KHX5300S2LLK2/4G 4GB 2X2GB PC2-5300 DDR2-667 CL4-4-4-12 200PIN SODIMM Memory Kit.

I installed the RAM first (see Maintenance and Service guide in the manuals link in resources below) in order to make sure it was working properly. One stick is on the bottom of the laptop behind a door, the other stick is under the keyboard. Past experience has shown that, of all components, RAM can be the most finicky. First I booted Finnix and ran memtest86 to completion without error (this takes a couple hours). Next I booted the original XP installation which also worked fine. Good – the risky part was done! Next step was to install the hard drive which is on the bottom behind a door but refer to the service manual (I really love the level of detail the big players provide in their documentation for servicing machines). The drive was detected by the BIOS properly so now it was time to attempt the Windows 7 installation.

Windows 7 64-bit

I purchased Windows 7 Business 64-bit since I wanted my client to be able to access the full 4GB of new RAM I installed. The installation went without a hitch and Windows booted. Everything so far had gone too easily, I knew it was time for a snag and it turned out to be missing video drivers forcing a very low resolution on this high-end LCD screen!

ATI Mobility FireGL V5200

Turns out that my assumption that I would be able to download the latest Catalyst driver package from ATI/AMD was wrong. If you browse through AMD’s site for the drivers you get met by a brick wall explaining the ATI doesn’t support the cards and leaves it up to the manufacturer to supply the drivers. At this point I was getting concerned since we all know manufacturer’s track record in providing updated drivers for new operating systems on old products. I guess from their perspective it’s better to sell a new laptop, but then what’s the point in buying premium equipment if it’s not going to be supported for years to come? Visiting HP Compaq’s support page for the nw8440 turned up no Windows 7 drives. Vista is there, but I wasn’t able to install those after it being suggested by someone on the Internet. This brings us to the main reason for this blog post since it took me 2-3 hours to figure this one out. Here’s what I did to resolve it:

  1. Download DH Mobility Modder.NET and install it
  2. Download the latest desktop drivers from AMD. I selected Graphics Cards – Desktop, Radeon X1600 Series, and finally Windows Vista – 64-bit. This gave me the 10-2_legacy_vista32-64_dd_ccc.exe file. Run the self-extracting archive and record the location it’s decompressing to. Once the installation program opens close it (this will leave the extracted files ready for you to monkey with)
  3. Run DH Mobility Modder.NET and browse to the directory. Click Modify
  4. Install these new drivers!

The device manager didn’t show any other drivers missing with the exception of the SD card reader, I installed the Vista Business 64-bit driver from HP and it worked a treat.

Final Words

My client was very happy with the new upgrades, and in this case, since it was a premium laptop it was worth the upgrade. If this was a consumer laptop I probably wouldn’t have bothered spending the time to upgrade it and would have suggested a new laptop, or just reinstalled Windows XP. I hope this post helps someone to save the time that it took me to figure out the display driver hackery!

Comments welcome!


First post!

Welcome! This blog is going to be mostly tech-related with a focus on the following concepts:

  • Linux desktop and server
  • System administration tips
  • Cool, free, and particularly useful open source projects
  • Interoperability between Linux/Windows/Mac/?
  • Who knows what else?

I might even get onto the soapbox on some real-life things outside technology, we’ll see.

Mostly the focus here though is to get down somewhere the things I have found to be particularly useful so I can remember how to do them again! Hopefully these things will also be useful for people out on the Internet.

Enjoy – Joel.