Archive for the 'Solution Writeups' Category

HRNUG Jan 2012: Developer + Sysadmin

Presentation on Improving Your System Management and Virtualization Skills

Below is a summary of a talk I gave to Hampton Roads .NET User Group in January 2012.

1st Part: Tools Developers Should (but don’t) Talk About

Developers are usually busy being great developers and just what their systems to work.  I’ve spent many years figuring out how to protect those systems and keep them running.  In this first part I’ve detailed the tools I feel are maybe outside the realm of a developers expertise but should still be running on their systems.

  • Web Of Trust - Under the category of “save you from yourself”. A browser add-in that helps you determine if a link or site leads you to a “bad” web page.  By “bad” it could be malicious, untrustworthy, or not safe for families, etc.  It’s user-driven so not always 100% correct (I’ve seen false positives) but the best feature is showing it’s stoplight indicators on google search results.  If you actually goto a page that’s suspect, it’ll darken the page and give you a big “are you sure”?
  • DynDNS Internet Guide (or Google Public DNS) – Similar result to Web Of Trust but more behind the scenes.  Honestly I think every home network router should be doing this.  There’s no down side.  You are changing the DNS server IP’s on your computer or home router to theirs (either Dyn or Google’s), which they will provide not only fast DNS lookups, but also filter the DNS results so you don’t end up on a bad website.  Similar to WOT, DynDNS will warn you first.  It also allows you to set custom settings with a free account if you are a parent and want to filter additional types of sites from all your computers.
  • Bitlocker - Another “no reason not to do this” on laptops.  To me it justify’s the extra cost of Windows 7 Ultimate (or Enterprise) to have this feature, which will encrypt your disk drives to prevent data theft if you loose your laptop.  It helps me sleep at night knowing my data is still protected in case of theft.  Just search the Start menu for Bitlocker and copy the key to your smartphone, email, or print it for safe keeping in case you ever need it (usually don’t) to boot the computer.
  • Nitro Reader - Outside the OS and the browser itself, the next likely security risks revolve around the browser add-in’s and some of the worst ones are Java and Adobe Acrobat Reader.  We can’t replace Java but we can ditch Acrobat Reader, and in the process get a better PDF program that does more for free then Reader.  Enter Nitro Reader.  Fast, modern interface with no ad-ware.  I recommend it to all my clients as a Acrobat Reader replacement (and upgrade) and so far everyone’s happy.
  • Microsoft Security Essentials - Free forever anti-virus/malware.  Rumor has it that it’ll be included in Windows 8 (FINALLY anti-virus built into Windows).  It gets high ranks for quality of the engine, plus my favorite feature: it almost NEVER bugs you, and that’s what we all want in a anti-virus, an app that we never have to mess with.
  • Secunia PSI - Do you ever wonder if you have any software on your computer that has known security issues?  Secunia PSI answers that question with a great tool that’s like a Windows Update for the rest of your apps. It scans your system and notifies you of software that has known security issues and a download link to the newest version to fix it.  I run it on my Windows systems monthly.  Only free for personal use.
  • Backblaze (or Mozy or Carbonite) – I used Carbonite years ago, and I’ve used Mozy for some business systems, but Backblaze takes the cake for the best whole-computer online backup solution.  It even backs up USB drives, and provides a bonus feature similar to a LoJack for your PC.  You should always use an automated backup solution, and now-a-days it’s easiest to use an online backup solution, so why not go with the best-bang-for-your-buck with Backblaze.  Here’s hoping you’ll never need it.
  • SugarSync (or dropbox or box) – I’ve used them for years to sync files between my multiple PC’s, as well as share files with co-workers or access my files when I don’t have my computer.  This is a sneaky way to get others who you share files with to keep those files you share backed up.  Plus, it prevents the need to always email files back and forth.

2nd Part: Virtualization for the Developer

Virtualization of PC’s for test and devlopment is not new, but some have still not taking the leap to this great solution.  Others maybe are using a tool that doesn’t meet there needs or could use some advice on managing their virtual systems, so lets start from the begining.

  • Why?
    • You are likely developing for a OS different then the one you are on.
    • Test Microsoft products quickly (pre configured): search “vhd” at www.microsoft.com/downloads and more listed at www.microsoft.com/vhd.
    • Use browsers of other OS’s or run your web app on a real IIS Server.
    • Allow you to run multiple versions of Visual Studio, Office, etc.
    • Use snapshots to test software changes on test virtual machines’s.
  • Getting Started
    • You should be running a 64-bit OS on your hardware (32-bit does work in some cases but is quite limited).  Not sure if you are 64bit?  Run msinfo32.exe and look for “system type” on the right and it hopefully says x64.  If it says x86 then sorry, you’re 32-bit.  There’s nothing to fear from reloading into x64.  It’s not the land-of-confusion it was 5 years ago.
    • Be sure your BIOS has virtualization enabled.  This Microsoft Virtual PC tutorial talks at length and gives you a tool to check, but basically there is a BIOS feature for your hardware to be “virtualization enhanced” that is often not enabled.  This is required for Hyper-V to work, and if not enabled VirtualBox will run much slower.
    • Terminology: The OS running directly on your hardware is called the “host” or “parent” and the virtual machine (VM) running inside the host is a “guest” or “child”.
  • Your Virtualization Options
    • Virtual PC
      • Free. Not recommended for developers.  It only works with 32-bit guests and is only designed to run Windows XP/Vista/7.  Designed for end users with legacy apps.
    • VirtualBox
      • Free.  Open Source.  The best choice if your running Windows 7 and all you need in 95% of scenarios.  You might consider VMWare a paid upgrade to this in terms of advanced functionality but if you don’t know why you need VMWare, you likely don’t.
    • Hyper-V
      • The best choice if you are running Server 2008 R2 or Windows 8.
    • VMWare
      • A good product, but to get features comparable to Hyper-V or VirtualBox you have to pay, a lot.
  • Virtualization File Formats
    • A virtual machine has 2 (or more) files associated with it.  The two you usually care about are the disk drive files and a configuration file.  Every virtualization software manufacture has their own standard for each (or more then one) and it can get quite confusing, especially if you want to download test pre-build images.  Stick with Microsoft’s .vhd.
    • Microsoft’s current standard (2011-12) is the .vhd disk format but with Windows 8 a new .vhdx format is emerging.  .vhd is used by lots of Microsoft products like the legacy Virtual Server 2005, Virtual PC, Hyper-V, and even Windows Backup.  If you want to keep things simple, always create your virtual machines using this .vhd format so they’ll work across any product (even VMWare and VirtualBox).
    • The configuration file stores hardware configuration such as number of CPU’s, RAM, how many drives, and NIC MAC addresses.  This file format is different in every product so usually you just recreate your settings if you swtich between, say, VirtualBox and Hyper-V.
  • Which To Use
    • Running Windows Vista/7: VirtualBox
    • Running Server 2008 R2 or Windows 8: Hyper-V
  • VM Management
    • Keep your .vhd’s (virtual hard drives) small.  Google “shrink vhd“, disable the Recycle Bin in VM’s, disable hibernate, use Spacesniffer to find large files and folders.
    • Keep your ISO’s and install files outside of the VM and use network shares or VirtualBox shared folders to access them.  Mount ISO’s from Hyper-V/VirtualBox rather then using inside the VM.
    • If you end up creating more then a few guest VM, learn how to use differencing disks (VirtualBox calls them immutable) to have one large source/root disk (use sysprep before making it read only) and then create new differencing disks on top of that for each VM you create.  For Server 2008 R2 this saves me 15GB of disk used per virtual machine.

The OCS 2007 R2 Communicator hyperlink mystery

I don’t think this problem/solution is much different in older versions.

Problem: when you send a link from Communicator client to another, the link isn’t clickable, has a _ (underbar) in front of it, or both.  Results may be different on different computers. It’ll look like this

_http://www.google.com

Solution:  Two things are happening here that are not related.  The first is the OCS Server (and Edge Server) have the URL Filter enabled, which are adding the _ underbar to all links.  Also called “Intelligent IM Filter”.  You need to tone that filter down or disable all together to your liking.  If users are coming in through an Edge Server, they will follow the Filter settings of the Edge Server they are using, which seams to supersede the Front End Server (my guess is the most restrictive wins).  So be sure to set it on both servers separately.  Results were instant in new IM’s.

The other issue is the lack of a clickable hyperlink.  If you disable the URL Filters above, the underbar goes away but links are still not blue and underlined.  To fix this you need to apply a GPO or set a local registry setting to allow Communicator to make hyperlinks clickable:

HKEY_CURRENT_USER\Software\Policies\Microsoft\Communicator\
new DWORD EnableURL=1

After that exit and restart Communicator.

In both of these cases they are secure by default, which is great; but even years after this features release over several versions their use and configuration are still a mystery to most starting out.

ActiveSync Random Password Prompts Fixed

They were getting random prompts for passwords in ActiveSync on Windows Mobile 6.0 and 6.1.  They had Exchange 2007, and ISA Server 2006, but this problem showed up months after Exchange was migrated to 2007.  It seemed random.  The error on ActiveSync was the generic:

please log in access was denied 0×85010002

In the ISA Monitoring you would see a denied connection on your ActiveSync rule with this status:

12239 The server requires authorization to fulfill the request. Access to the Web server is denied. Contact the server administrator.

I tested with Windows Mobile Emulator from outside the firewall and was able to reproduce the error within hours (just letting it sit there).

I first thought this was the HTTP session timeout that changed with a Exchange 2003  service pack when Direct Push came out back in 2005.  I remembered that setting and looked under the ISA Web Listener for ActiveSync on the Connections tab>Advanced>“connection timeout”.  The wizard had correctly set it to 1800 seconds (30 minutes). No dice.

I poked around the web listener settings some more and noticed the timeout settings for forms authentication were set (this same web listener was used for OWA).  ISA is supposed to be smart enough to not apply any of the forms auth settings to clients that don’t support it (falling back to basic auth as with ActiveSync).

ISA Web Listener Advanced Form Options

Tom and the forums at isaserver.org confirmed my suspicion.  The forms auth timeout was indeed affecting ActiveSync.  To find it, look for the web listener of your ActiveSync rule, go to properties>Forms tab>Advanced> and make sure “apply session timeout to non-browser clients” is unchecked. 

 

DCPROMO demote error on Domain Controller

On trying to remove a old server from the directory (2003 server in a 2003 forest) I received this error

Failed to configure the service NETLOGON as requested “the wait operation timed out.”

DC demote error

The root problem was that this domain controller had a DNS entry to another domain controller that no longer existed.  It was trying to contact it but couldn’t.  Removing that entry and running dcpromo.exe again solved it.

ISA 2006 from Edge Firewall to 3-Leg Perimeter

ISA FirewallWhat if you want to take your simple 2 NIC “Internal/External” firewall and add a DMZ to it on the fly?  We recently tried this on a production firewall no less and hoped it would work.  It did after a few bumps. 

The big problem with changing your Network Template is that ISA wants’ to slick your config and start over, so you’ll end up with two options: Try to make a 3 NIC config work in  your original design by adding in networks and network rules, or applying a new network template and then bringing your config back in via import.  After failing the former (likely my lack of skills), we chose the later.

Mileage may very, but here’s some notes on what we did:

  • Obviously you need the 3rd NIC installed first.
  • Add the Subnets to the new NIC’s IP config for your DMZ aka “Perimeter” network in Windows.
  • Export your firewall config, including all settings, make a copy of the XML file, and open for editing.
  • We’re going to remove the network section of the XML file to prevent issues later.  Once you’ve chosen a new network template, you’ll want to import the config back in, minus the network related stuff (which is what the network template will change for  you).
  • Search the XML file for the open and closing NetConfig tags:
  • <fpc4:NetConfig StorageName="NetConfig" StorageType="1">
  • </fpc4:NetConfig>
  • Remove everything between these two tags and save the file.
  • Run through the network template wizard for 3-leg perimeter.  If clicking finish generates errors, work through them and come back to try again.  Our single error was because we had web listeners using HTTP compression, so we removed all objects from “General > Define HTTP Compression > Return Compressed Data” and added them back in later after re-import.
  • Once template wizard works, notice the lack of rules in your firewall policy and missing objects.  About now your thinking “OMG you screwed me!”, so import your augmented config and they should all be back. 
  • You’ll likely have a few dupe firewall rules if you chose a template firewall policy other then “block all”.  Sort your rules by the various columns to look for dupes.  We had dupes for “Allow Internal Routing” and “VPN Clients to Internal Network”.
  • Lastly go through your rule list and ensure the From/To columns are filled in.  You’ll want to restart the firewall service at this point to be sure it can start properly, and if it fails it’s likely a rule that won’t work in the new network config.  Check event logs for hints.  We had several rules we deleted and recreated based on new network names.
  • Subscribe

    Twitter Updates