Installing Ubuntu 14.04 LTS as a Generation 2 Hyper-V guest

Since Microsoft release Windows Server 2012 R2 Hyper-V have had two different generations of virtual machines. The old “Generation 1” and the new “Generation 2”. Microsoft added generation 2 to get rid of the old stuff that really doesn’t make sense in a virtual world. And also to add new stuff. Generation 2 virtual machines provide the following new functionality: PXE boot by using a standard network adapter Boot from a SCSI virtual hard disk Boot from aSCSI virtual DVD Secure Boot (on by default) UEFI firmware support As can be expected all of these features worked fine straight away with Windows 8 (64-bit) and Windows Server 2012 or later. But they did not work well with Linux. Until now. ...

May 21, 2014 · 2 min · Joakim Westin

PowerShell loves enumerations

One of the things that make PowerShell oh-so-great is its tight integration with .NET Framework. As a simple example, in the framework there are many pre-define values, often stored as enumerated types. Enums are great because they allow us to define a set of values and then let the user (or program) choose among these values. Another great thing with PowerShell is that it makes command arguments ‘pickable’ on the command line. So if I’m running a command and I am unsure of which arguments can be used I can simply press tab and I will se the first valid parameter value. Let me show you the simple beauty of Enums together with PowerShell scripts. ...

May 8, 2014 · 2 min · Joakim Westin

$env:HOME doesn’t work in PowerShell $PROFILE

Today I wanted to setup my PowerShell $PROFILE to make it easier to work with all the modules I learned about at the PowerShell Summit. I wanted to add an additional path to the environment variable $PSModulePath. Something that should be a picece of cake. I store additional modules in the folder ‘Documents\WindowsPowerShell\Modules’ under my userdirectory (C:\Users\Joakim). So simply joining the path using Join-Path and add the result to $ENV:PSModulePath should do the trick: ...

May 5, 2014 · 2 min · Joakim Westin

Quick way to name your NICs in Windows Servers

If you, like me, manage many servers, it’s essential to name network adapters in a way that makes it easy to troubleshoot issues when they arise. In complex networks with thousands of servers and all servers connected using multiple paths a consistent naming standard is very important! PowerShell and the cmdlets available in Windows Server makes naming adapters a breeze. The servers we usualy deploy have built in four (4) port network adapters. We like to name the Windows NICs the same as is the default in Linux; eth0, eth1, etc. ...

September 18, 2013 · 1 min · Joakim Westin

Enumerate UPNP devices

At home I have a Sonos system. It’s probably the best of any device that I have owned in terms of quality, usability and sheer happiness. The Sonos system has been working just fine for many years. It just works! Recently I was fortunate enough to get a direct fiber into my house. Needless to say this triggered me to update my home network. Part of this upgrade was to install Ubiquiti long range access points for better performance and coverage as well as a new firewall. After this network upgrade Sonos system then started to behave strangely which brings me to the reason for this post! ...

February 15, 2013 · 4 min · Joakim Westin

Generate Passwords Using Powershell

The other day I needed to generate some 1400+ new user passwords. Being a lazy person I figured that PowerShell could rescue me. This is what I did to check that my idea worked: PS C:\> Add-Type -AssemblyName "System.Web" PS C:\> [System.Web.Security.Membership]::GeneratePassword(10,2) 35&OjFtM^k As you can see this generates a password that is 10 characters in length and contains at least 2 non-alphanumeric characters. Now all I needed was to iterate this 1400 times and then output the result to the clipboard, simple as pie: ...

August 22, 2012 · 1 min · Joakim Westin