Thursday, September 27, 2012

How to Dual Boot Windows 8 and Windows 7


Generally when a new operating system version is released, people are timid about making the leap to upgrade to the new version. Many people want to take some time to try the new version while retaining access to their old files and folders on the older release.

This post will cover how to dual boot Windows 8 RTM and Windows 7. Before trying this procedure, be sure to back up your data in case something goes wrong.

To start out, I have a Windows 7 installation on a 120 GB disk. My Windows 7 files and data are only taking 20 GB or so and I want to create a partition to install Windows 8 using 50 GB (Note that the minimum recommended size is 20 GB, but I usually prefer 40-50GB). First, access the disk manager using mmc or by typing the following

  1. Windows key + R to access the run prompt
  2. Enter "diskmgmt.msc" and press enter
You can also use the search bar in the start menu,

Once you are in disk manager, right click the partition that belongs to Windows 7 and click "Shrink"

After you click shrink, specify 50 GB or whatever size you actually want (20 GB is the recommended minimum). Note that 50 GB = 51200 MB.

Click Shrink to start the shrinkoperation on the volume

Now that we have space for a 50 GB volume, restart and boot off of the Windows 8 DVD or Bootable USB Media.

We go through the installation procedure as follows. Select your regional settings and click next,

Then click "Install now"

Accept the EULA and start a Custom Installation,

Select the 50 GB of unallocated space that we created and click next

Wait for the install to complete (or grab a cup of coffee or a donut)...

After the reboot, the boot loader should show the older Windows release and the new Windows 8 option that we just installed.

You might also like
Navigating the Windows 8 User Interface
How to Create USB Windows 8 Installation Media (also works for Windows Server 2012, Windows 7, Windows Server 2008 R2)

How to Create Bootable USB Installation Media for Windows 8 and Windows Server 2012


There are a number of reasons to install Windows off of USB Media instead of using a DVD. Some of them include
  • Installing from USB Media is usually faster than an optical drive
  • Some newer PCs (like an Ultrabook that I just bought) do not have optical drives of any kind
  • Perhaps you ran out of blank DVDs and the store is closed...
Since this procedure involves formatting a flash drive, the reader is cautioned to back up all of the data on the system (you'll see why later) and to make sure that anything that needs to be kept is backed up off of the flash drive. To perform this process, you will need access to Windows 8 media (either in ISO format or DVD) and you will also need a flash drive (> 6 GB).


To start the process, open a command prompt with an administrative authentication token,

If your command prompt is not pinned to the start menu, simply type cmd into the search bar, then right click the command prompt that appears and select "run as administrator." Then type diskpart and press enter. You should be here at this point,

Enter "list disk" and hit enter. It should be pretty clear form the sizes which disk is the flash drive. For me, it is Disk 3. Be sure to select the right disk, or you will destroy all of the data on one of the other system disks (this would be very bad for most people). For me, it is Disk 3 because I am using an 8 GB flash drive

Next, type "select disk 3" while substituting 3 for the right disk number on your system.

Now type "Clean" and hit enter. At this point all of the data will be gone from the disk (though it could still be recovered by a forensic analyst/data recovery company)

If you selected the wrong disk, you have a big problem now... If you selected the right disk, you can create a new partition by typing "create partition primary" and hit enter

This should be partition 1, but type "list partition" to be sure.

Now select partition 1 and format the partition as a FAT partition.

Mark the partition as active and we are ready to copy files over,

Mount the Windows 8 or Windows Server 2012 ISO and copy all of the files on the ISO to the newly created/formatted volume.

At this point, you now have bootable Windows 8 or Windows Server 2012 USB media.

Wednesday, September 26, 2012

Adding Multiple Mail Accounts in Microsoft Mail for Windows 8


The mail application in the release preview versions of Windows did not support adding mail accounts for IMAP/POP accounts. In the Windows 8 RTM release, the Mail App supports adding e-mail accounts for Hotmail, Live, MSN, Exchange, Office365, and, Google/Gmail, Yahoo, and a custom account type that allows IMAP/POP accounts to be added. To add an account, access the settings by pointing your mouse or tapping the top right or bottom right corners of the App

Note that you have to be in the Mail app to see the right settings. Then click Accounts

From here, you can select the right type of account to add

If you are adding an IMAP/POP account to Windows Mail in Windows 8, you can either enter your e-mail/password and have the app try to find the right settings, or you can view more details and specify server names/ports and SSL/TLS settings.

That's all there is to it.

You might also like:
Navigating the Windows 8 User Interface

Sunday, September 23, 2012

How To Set Up A New Active Directory 2012 Domain


Establishing a new Active Directory domain in Windows Server 2012 involves planning along the following areas:
  • Choice of forest/root domain names
  • Number, type, location, and sizing of domain controllers
  • Special administrative issues that may require multiple domains/forests
  • Administration model/OU structure
  • Planning sites/subnets/replication
These are all issues that needed to be planned in previous Active Directory versions, but new with Windows Server 2012 is the ability to install the Active Directory Domain Services role without installing the DNS Server role. This is useful because some organizations use a different platform for DNS (such as ISC's Bind). There is also a possibility that there are more need for Active Directory/LDAP processing than DNS services and having the DNS server role installed/running takes significant system resources that might be better used for other processing.

Like Windows Server 2008 and Windows Server 2008 R2, installation is a two step process:
  1. Install the Active Directory Domain Services (ADDS) Role
  2. Promote the first DC in the forest
The first step in the process is determining what we are doing. In this case, we want to create a new forest and a new root domain (as opposed to adding a DC to another domain or adding a new subdomain).

Next determine the domain and forest functional level for the new Active Directory Forest/Domain. A rule of thumb is to not choose a level that is greater than the oldest OS version expected to be used for the domain controller (i.e. don;t pick 2008 or 2008 R2 if you plan to promote a 2003 domain controller). Note that this setting has no implications for the types of clients/non DC servers that can be joined to the domain. This step also allows you to decide whether to install the DNS role and create AD-integrated zones for the new forest/domain. Most native Windows environments will need at least 1 DNS server (and preferably more to not create a single point of failure). The first DC promoted in the forest has to be a global catalog server and cannot be a read-only domain controller (RODC). Finally, the directory services restore mode password should be documented in the event that the directory needs to be restored from backup.

If you choose to install the DNS role, you may have the option to create a delegation for the server to host the piece of the DNS namespace that is covered by the forest/domain. Most companies that invent a top-level domain will not have the ability to do this. Organizations that use a subdomain of their existing DNS namespace or use a real registered domain may have the ability to create the delegation. 

Next, choose a NetBIOS domain name to correspond with the new forest/domain. This is a single label that is typically the first component of the domain name (ex -> AD, mikesblog.lan -> MIKESBLOG).

Finally, configure the storage location for the Active Directory database and transaction logs. For domains expecting heavy DC use, it may be advantageous to place the database and log files on separate high speed volumes. The SYSVOL folder should be placed in a location with adequate space to store group policies, logon scripts, and anything else that the domain admins want to replicate to all of the DCs. This may need to be moved to external storage if the organization heavily utilizes group policy software installation.

Finally, you can review the options and generate a script for deploying DCs with the same configuration.

Below is an example of the script generated to create a new forest using the Install-ADDSForest cmdlet.

After that, your new domain is set up, but the domain controller that you just created is a single point of failure. You should probably install a second one.

Tuesday, September 18, 2012

Navigating the Windows 8 User Interface


During the beta/release candidate phases of Windows 8 development, I couldn't help thinking "Is Microsoft insane? The new user interface totally sucks..." Since I installed the Windows 8 Enterprise RTM and have used it for a few weeks, I've reversed my position on how I felt about the user interface.

I dare say that Microsoft has created one of the cleanest and easy to use interfaces I've seen in any version of Windows (or any other operating system, including Apple's iOS). Using the Windows 8 interface comes down to managing the learning curve because there are a number of radical changes from the traditional Windows OS. I'll cover a few of the biggest changes and how to adjust to the new user interface.

Where did my start menu go?

The start menu is radically different in Windows 8, but you still access the start menu in almost the same way that it is accessed in Windows 7. Instead of having a "start orb", you simply move the mouse to the lower left corner of the screen:

The start menu looks a lot different too, pinned tiles are placed on the start menu for commonly used applications ("apps" nowadays).

Should you want to see everything on the start menu, right click and select "All Apps."

I've found that I almost never do this anymore. Instead, I use the new "Search" feature of the menu that pops up when you move your mouse to either the top-right or bottom-right corner.

With the search feature, a few characters of the application's name (or the full name of anything within the %PATH% variable) can be found.

What about metro apps?

Metro style apps are the new paradigm for Windows development. They are different from traditional Windowed applications because they  provide a full-screen, always-on, immersive, user experience. Windows Phone users will see a striking similarity between Windows Phone 7 and Windows 8.

Despite the advertising hype, these apps do continue to consume resources in the background (though their resources are minimized using a few tricks with the Windows kernel) and the biggest pain point that I had was learning how to close a "metro" style app. The easiest way is to move the mouse to the top middle of the screen (so that the cursor becomes a hand), then drag the top of the app to the bottom of the screen.

Open Apps can be switched using alt+tab or by moving the mouse to the top-left corner.

How do I shut down/restart/put my computer to sleep?

It is easy to hut down, restart, or sleep the computer by accessing the settings using the top-right or bottom-right corners of the screen,

The bottom line...

Like it or hate it, the new user interface is here to stay. It takes some getting used to, but it is a significant improvement on the old start menu paradigm and the new user interface provides a decent experience on both the PC and tablet.

You might also like:
Adding Multiple Mail Accounts in Microsoft Mail for Windows 8

Friday, September 14, 2012

Get HyperTerminal in Windows 8 and Windows Server 2012


Who needs HyperTerminal nowadays?

If you run any of the myriad of devices that use any form of serial connection (ex. RS-232) or an application that is built against the HyperTerminal library, you likely need a console emulator like HyperTerminal or an alternative. A lot of devices that still use serial cables include networking devices (routers, switches, load balancers, etc), CRAC (Computer Room Air Coonditioner) units, Power distribution panels, bank vaults, and many others.

HyperTerminal is the classic serial console communication tool that was provided with Windows up until Windows XP and Windows Server 2003. In windows Vista and Windows 7, Hyperterminal still works, but you have to copy it from a Windows XP or Windows Server 2003 machine (it is easy to just build a VM for this purpose and destroy it later). Don't have XP or Server 2003? Check out these alternatives! These two files need to be taken from the Windows XP/Server 2003 installation:

c:\Program Files\Windows NT\Hypertrm.exe

As long as the hypertrm.exe executable can find the hypertrm.dll library, you can install this anywhere on a new Windows 8 system, though it might be logical to place the files in c:\program files (x86)\HyperTerminal\ and create shortcuts or place them in c:\Windows\System32 (this is part of the default system path, so you can simply run hypertrm from the run command or the search menu).

If you don't have access to a Windows XP or Server 2003 installation, don't worry, there are a number of alternative serial emulators for Windows 8 and Windows Server 2012.

Mounting an ISO Image in Windows 8


There are a number of things that have been relatively standard in the open source world and have left Windows users to ask the "why can't windows do this yet?" Even through the service packs for Windows 7 and Windows Server 2008 R2, it was impossible to mount/extract an ISO image without a tool like Virtual CloneDrive or Daemon Tools. In Windows Server 2008 R2, you could mount an ISO for a Hyper-V guest using the Hyper-V management tools, but not for the host OS.

Microsoft made this feature really easy in Windows 8 and Windows Server 2012. Simply navigate to the folder with the downloaded ISO image, right click the image, and click "Mount"

Windows automatically assigns a drive letter and drops you into the drive root in Explorer:

If you are done with the ISO and are ready to unmount it, simply eject the drive by right clicking the appropriate drive letter and selecting "Eject."

That's all there is to it. Microsoft did a good job in Windows 8 making this a clean process... It's about time...

Monday, September 10, 2012

awk Script To Combine Lines Of A File or Output


I ran into a unique problem where I needed to combine 3 lines of numbers into a single line separated by spaces (ironically again, to use awk to generate C# code that does something interesting). I found posts that gave me an idea for how to accomplish the task; however the examples that I found don't cover what to do if there are no indications of the next "record" to parse (i.e. some sort of starting delimiter):

   if (i == 3) {
      print l
   else {
      if (i == 0) {
      else {
         l=l" "$0
END {print l}

This script can be generalized to combine N lines of output by replacing the line:  
if (i == 3) {


if (i == N) {

where N is a variable or the desired number of lines to combine. This can eliminate a tedious job like deleting newlines from a file (particularly when copying some PDF tables into a text editor like notepad, emacs, or vi) and make a task part of a larger and more automated process.  Replacing $0 with $1..$n will only concatenate the nth field. This is easy to run on UNIX/Linux (since awk is included with most distributions), but on Windows it requires Cygwin (which I use) or a native port of the GNU awk utility (check out the GNUWin32 project on SourceForge).

How to Determine Installed Sharepoint 2010 SKU


I had an issue arise where I had to determine whether a SharePoint 2010 server was installed with SharePoint 2010 Foundation or one of the SharePoint Server products (Standard/Enterprise). After a lot of searching, I found an MSDN article that shows how to perform the task in .Net, but this seemed fairly useless because I didn't want to have to compile an application in C# just to determine the version. Below is a PowerShell port of the application demonstrated on MSDN:

# SharePoint 2010 SKU List Script
# Developed/Copyright September 2012 by Mike Burr
# Provided AS-IS With No warranty
# Based loosely on

$featureindex = @{}
$featureindex["BEED1F75-C398-4447-AEF1-E66E1F0DF91E"] = "SharePoint Foundation 2010"
$featureindex["1328E89E-7EC8-4F7E-809E-7E945796E511"] = "Search Server Express 2010"

$featureindex["B2C0B444-3914-4ACB-A0B8-7CF50A8F7AA0"] = "SharePoint Server 2010 Standard Trial"
$featureindex["3FDFBCC8-B3E4-4482-91FA-122C6432805C"] = "SharePoint Server 2010 Standard"
$featureindex["88BED06D-8C6B-4E62-AB01-546D6005FE97"] = "SharePoint Server 2010 Enterprise Trial"
$featureindex["D5595F62-449B-4061-B0B2-0CBAD410BB51"] = "SharePoint Server 2010 Enterprise"

$featureindex["BC4C1C97-9013-4033-A0DD-9DC9E6D6C887"] = "Search Server 2010 Trial"
$featureindex["08460AA2-A176-442C-BDCA-26928704D80B"] = "Search Server 2010"

$featureindex["84902853-59F6-4B20-BC7C-DE4F419FEFAD"] = "Project Server 2010 Trial"
$featureindex["ED21638F-97FF-4A65-AD9B-6889B93065E2"] = "Project Server 2010"

$featureindex["926E4E17-087B-47D1-8BD7-91A394BC6196"] = "Office Web Companions 2010"

#Clean method for getting all of the registry value names in a particular key
$path = "HKLM:\SOFTWARE\microsoft\Shared Tools\Web Server Extensions\14.0\WSS\InstalledProducts"

$regvalues = Get-Item $path | select -ExpandProperty property

# Cycle through all of the registry values

foreach ($i in $regvalues) {
   Write-Debug ("i: " + $i)
   $value = (Get-ItemProperty -Path $path).$i
   Write-Debug ("Value: " + $value)

   #For each value that we look at, are any of the corresponding SharePoint SKU GUIDs represented?
   foreach ($feature in $featureindex.Keys) {
      #If these are equal, then we have a particular SKU installed
      write-Debug ($value + " == " + $feature + " ?")
      if ($value -eq $feature) {
         write-output ($feature + " --> " + $featureindex[$feature] + " is installed")

There are third interesting pieces to the script. One is the easy way to iterate through the registry values contained in a particular key. The second is how to get the actual value (once you have the name). The third is that you can determine which SKUs are installed by using the InstalledProducts registry key created when SharePoint 2010 is installed.

To run the script, all that is needed is read access to the appropriate registry key and its values.