Monthly Archives: January 2013

Installing Hyper-V Blind

One of the initiatives at work right now is to prepare for / expand on IPv6 adoption. We have a great lab environment just begging to be hacked away at and it’s a perfect chance for some self-paced real-world learning on cool stuff that doesn’t apply directly to my daily responsibilities.

To that end, we needed a VM environment so we don’t crowd up the lab racks with physical hardware. We’re entirely a VMware shop but where’s the fun in just spinning up another ESXi host? My goal:

  • Server 2012 Standard – It would’t really be a fair virtualization tech comparison if we went with Server 2008 and it’s Hyper-V 2.0. We need new and 3.0!
  • Server Core install – That means no GUI! Command prompt and powershell is required until the system is up enough to accept remote management connections that have a more GUI-driven interface
  • Configure Hyper-V as much as possible using PowerShell. But I do hope to enable things so that my colleagues can fall back on the GUI as needed
  • No using IPv4 during setup. I want it going through the virtual switch and available to guests at the end, but that’s it

So that I can look a little more bad-ass in the lab when I’m working on this, I decided to do a test run at home and get through a bunch of the “how the hell do I _____ ?” stuff. Here’s my notes on everything I ran into:

  • Use setres -w #### -h #### to change the screen resolution
  • There’s a decent “Getting started with Server Core” guide on TechNet that the rest of my notes are based around
  • Get-NetIPInterface is frustrating because it won’t show me the MAC of these interfaces
    • Came up with this instead:
      Get-NetAdapter | Select Name,MacAddress,ifIndex,Status
    • To rename an adapter: (annoyingly can’t use the interfaceIndex property)
      Rename-NetAdapter -Name “Current Name” -NewName “New Name”
    • To set a static IP:
      New-NetIPAddress -InterfaceIndex ## -IPAddress -PrefixLength ## -DefaultGateway
    • No info ANYwhere on how to switch back to DHCP though using PowerShell and not WMI though
  • Didn’t find a suitable powershell equivalent for what ipconfig does for me
  • To join to AD, use Add-Computer with no parameters and you’ll be walked through. Make sure the computer object is created in AD beforehand. Looks buggy according to internet. Failback method is netdom)
  • Rename-Computer does just what you’d expect
  • Can’t believe slmgr.vbs is still the command-line way of activating Windows
  • Install-WindowsFeature feature1,feature2 (dependencies automatically grabbed. Use -whatif to show them)
  • End of testing. Can’t install Hyper-V role within Hyper-V it looks like, despite being able to install Hyper-V under VMware (after some tweaks). I probably just don’t know the equivalent tricks


One of my main focuses at work has been AD migrations. The overall project is going frustratingly slow but at the same time is abnormally complicated. Thus my entire day, every day (plus .5-4 hours of overtime) is spent on it. And to make anything else get done I have to volunteer extra of my time.

To keep my sanity between wanting to do fun things, dealing with a massive project, and correcting lots of human error, I decided to spend a few late nights automating as much as I could for this migration project with PowerShell. Through the process I believe I significantly leveled up my scripting skills, and turned many mundane tasks into an automated process. Here’s an overview of what the script does:

  1. Read a manually generated list of users/computers/groups that are migrating together as a “migration wave”
  2. Identify if/where/what those objects are in both the source and target domains
  3. Search a database for additional computers that a listed user may be logging into and add it to the migration wave. The database is populated via a login script GPO utilizing the BGinfo sysinternals tool
  4. Filter out objects that are conflicts, have typos, or appear to be already migrated
  5. (Optionally) move everything that wasn’t filtered out to a staging area in the source domain and set a couple ADSI attributes
  6. Generate separate Group/User/Computer import files compatible with Quest migration tools
  7. Provide an email report of the status of each item in the migration wave

The great thing about this script is it pretty much eliminates the need to manually search for conflicts, you never have to re-type things or click through the clunky Quest AD user interfaces, and it provides a clear report for everyone on the project of what’s going on. An added bonus for anyone familiar with PowerShell is that the migration wave list is output as a custom PS object, meaning it can be saved as a variable, piped to another command, or otherwise manipulated. If I were a little more familiar with the Quest PowerShell plugins I wonder if it could actually perform the migrations for us entirely…

At some point I’ll go back through the script, do a final cleaning to remove company-specific info and post it for anyone who needs it. Please let me know if this sounds helpful – things always get done sooner with some friendly motivation.

The Convenience of Windows 7

It’s funny, the only thing I miss from Windows 7 is the “USB / DVD Download tool” that turns an ISO or DVD into a bootable USB drive.  I’m perfectly capable of running the diskpart commands to format a drive and then copy out all the ISO contents, but the Microsoft tool was pretty convenient.

Adding to my frustration is trying to search for “Windows 8 USB / DVD Download tool” to see if they’ve brought it forward to work on Windows 8.  Unfortunately the results are a million articles about how to upgrade your Windows 7 machine using the Win7 tool.

In related news, I was at a friend’s house the other day and someone commented that Windows 8 is horrible because A you have to log off to be able to shut down the computer, and B during the install you have to watch the tutorial of moving the mouse to corners of the screen.  It’s silly, considering that with one of the corners you can put the mouse into the option to shut down the computer without logging off first comes up. Everyone hates stuff that’s new apparently. Pretty sure I wouldn’t want to be a commercial OS developer for that reason alone.

2013 New Year Resolutions

I originally started out this post with “It’s a short list, but…”, and after writing out the list I’d say it’s a pretty reasonable size.

  • No more double spaces to end sentences. Although I think it’s a bigger deal that people would notice and complain than whether or not there’s actually an extra space in there, it just seems to be the way things are going
  • I intend to adhere to the DRY (Don’t Repeat Yourself) coding principle hard core. I’m already rewriting some PowerShell scripts at home to help solidify my commitment
  • I’ve taken a more serious approach to my resume. Gone are fun words like Jedi and Wizard. Replaced are many many bullet points
  • Set a schedule and add more time to my day. For example, I’ll be setting up a calendar reminder starting this weekend to bug me weekly to write a blog post here. By being more schedule-based I hope to be more focused and not waste away time being distracted and less focused on tasks at hand. I already try to avoid watching tv/movies and gaming at the same time – it’s time to expand that out to more aspects of my life
  • No more soda! I’ve quit cold turkey and while I’ve already had a couple panic moments of “OMG I WANT COKE” I’ve been getting by alright. I hope to never give in to the temptation of the free soda at work
  • Find and act on measurable career improvement opportunities. My (kind of former) boss has been helping me with career performance evaluations. His guidance has been super-helpful already. Last night I assessed all of it to look at the bigger picture and will be actively working to improve my “Operational Skills”