Monthly Archives: January 2014

PowerShell – Get Internet Explorer Version from Remote PC

Today a colleague asked me if there is a way to get the current Internet Explorer Version of multiple Remote PC´s (He needed to make sure that all these PC´s had at least Internet Explorer 9 so that his applications would run correctly.). Of course there is a way. I used PowerShell to solve this problem. I wrote a simple PowerShell Script which gets the Internet Explorer Version from the Remote PC´s Registry. Here it is:


$Registry = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $ComputerName)
$RegistryKey= $Registry.OpenSubKey("SOFTWARE\\Microsoft\\Internet Explorer")
$Value = $RegistryKey.GetValue("Version")


The Script above will return the Version Number of the Remote PC´s Internet Explorer when you have the appropriate permissions.

Since I wanted to make my Script a bit more useful I created a function.

function Get-IEVersion

$Registry = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $ComputerName)
$RegistryKey= $Registry.OpenSubKey("SOFTWARE\\Microsoft\\Internet Explorer")
$Value = $RegistryKey.GetValue("Version")

return $Value

And used my new function in another Script.


Import-Module .\Get-InternetExplorerFunctions.ps1

Get-IEVersion $ComputerName

I gave my function to my colleague and he was happy that his problem was solved.

You can download the Scripts above from here.



Add www-data user to sudoers file (WANEM)

Hi. In this post I´ll show you how to add the www-data user to the sudoers file. The reason why I am blogging about this is the following: If you followed my Instructions to install WANEM like in my previous post “Installation of WANEM” you will notice that you can not apply settings to your WANEM machine via the configuration website. But why is that so?

Well, you can not apply settings to your WANEM machine via the configuration website because the user www-data who wants to apply your settings for you on the machine does not have the permissions to do so. This can be a very annoying mistake so I decided to write down the solution.

I will show you how you can solve this problem.

Before we begin I recommend that you make a backup of your current sudoers file.

sudo cp /etc/sudoers /etc/sudoers-old

Now we need to edit it.

sudo nano /etc/sudoers

You need to add the following line to the sudoers file to grant the www-data user the appropriate permissions:


That´s it. Now all you need to do is reboot your machine and try to apply your settings. It should work now.



Enable IP Forwarding in WANEM

In this post I will show you how you can enable IP Forwarding permanently in WANEM if you installed it to a hard disk like I have shown you in my last post “Installation of WANEM“.

Important Note: The following steps will only work if you chose debian as System like I did.

You can check if IP Forwarding is enabled with the following command:

sudo cat /proc/sys/net/ipv4/ip_forward

If you receive 0 as an answer it means that IP Forwarding is disabled. If you receive 1 as an answer it means that IP Forwarding is already enabled.

Before you perform the steps to enable IP Forwarding I would recommend you make a backup of the options file in case you want to revert the configuration. You can do this with the following command:

sudo cp /etc/network/options /etc/network/options-old

Ok. Now we will enable IP Forwarding.

The First step is to edit the options file. I used nano to edit the options file.

sudo nano /etc/network/options

You need to change this line from




Now press Ctrl+O to write the changes to the file and press Ctrl+X to exit nano.

Now the last step is to restart the networking service. You can do this with this command:

sudo /etc/init.d/networking restart

That´s it. IP Forwarding is now enabled.



Installation of WANEM

WANEM is used to emulate WAN links. It is often used for testing applications over long distances with high delays and packet loss. You can use WANEM running on a physical or virtual machine using the Live CD Image provided here. You can use it as it is or you can install it on your hard disk so you don´t have to do the same configurations every time.

I will show you how to install WANEM on a virtual machine using Microsoft Hyper V.

By the way: I used WANEM v2.3.

The first step is to download the WANEM Image. You can download it from here.

Now you need to create a new virtual machine. I called my virtual machine “WanEm”, assigned 512MB RAM and created a new VHDX hard disk with 10GB capacity.Create_Virtual_Machine_0Create_Virtual_Machine_1Create_Virtual_Machine_2

Now go to you virtual machine´s settings. Since the default Network adapter Hyper V assigns to virtual machines will not work you need to remove it and replace it with a “Legacy Network Adapter“.


Now start you virtual machine and insert the WANEM Image you downloaded earlier.

You will be welcomed by the screen below. Press ENTER to continue.



If you are asked if you want to configure all interfaces via DHCP choose no. You will need to configure a static IP address later so you can access the built-in website to configure WANEM.


Hit ESC to Exit.

If you are asked for a password for the user perc just enter a new password and confirm it by retyping it.

Now exit to the Shell by typing



To start the installation enter






Choose Partition.


Select your hard disk you created earlier. (Use SPACE to select the disk.)


Now create a new partition. I chose to use the Template.



Now choose Configure Installation.


Now choose your system. I chose debian.


Choose the partition you want to install your system to.


Now you will be asked what filesystem-type you want to use. I chose ext3.

After that you will be asked to create a new user and assign that user a password. And you will be asked to assign a new password to the Administrator account (root). And you need to assign a computer name.


Next you will be asked where you want to install the boot-loader. I chose mbr.


Now you can choose Start Installation.


Now is the last chance to check your configuration. If you hit Next the installation will start.


After the installation process has finished you will be asked to insert a floppy into your floppydrive. Ignore this part and choose No.


That´s it. The installation process was successful.

Now enter



Your machine is now ready to use.

If you don´t want to go through all these steps by yourself you can download the VHD Image I prepared for you from here.


Tagged ,