Sunday, August 19, 2012

Bloody Queen Mary

This is a Bloody Mary (it's technically a Caesar because of the clam juice) that will make you famous.  Or at least, a legend in your own mind.

4 1/2 oz Clamato Juice (or a 2:1 mixure of tomato:clam juice)
1 1/2 oz your favorite gin
1 tsp celery salt
1/2 tsp black pepper
1/2 tsp Tabasco sauce
1/2 tsp Lea and Perrin's Worchestershire sauce
1 drop Beano's Horseradish sauce
Juice of 1/4 lime

Combine all ingredients and shake vigorously.  Pour into a Collins or highball glass, and garnish with a deli pickle spear (don't you dare use a dill), rind of the squeezed lime, and leafy celery heart, and a couple of queen olives.

Friday, August 17, 2012

Move Wireless Network Profiles Between Computers

Ran into an interesting customer issue regarding connecting to a wireless network.  For whatever reason, this laptop can't see the wireless network (though others in the office can).  This laptop can connect to other WiFi networks without issue.

My laptop, for example, was able to connect without issue.  Solution?  Either manually create the profile or export it from my laptop.

Since I'm all about finding new and interesting ways to do things, I'd thought I'd try the "Export/Import" route.

There's a little-known gem of a feature in netsh that allows for just this.

  1. Open an elevated command prompt.
  2. Type netsh wlan show profiles and press [ENTER].
    - The output should look something like this:

    C:\Windows\system32>netsh wlan show profile
    Profiles on interface Wireless Network Connection
    Group policy profiles (read only)
    ---------------------------------
       

    User profiles
    -------------
        All User Profile     : OPincGuest
        All User Profile     : antares
        All User Profile     : SparkDetroit
        All User Profile     : SecureConnect
        All User Profile     : cobo_free
        All User Profile     : Colonial 1
        All User Profile     : Team Perkis-guest
        All User Profile     : MongoNet [Working]
        All User Profile     : Inn Public
        All User Profile     : Android76
        All User Profile     : bww3
        All User Profile     : TGN
        All User Profile     : attwifi
        All User Profile     : aguilmettes-iPhone MyWi
        All User Profile     : HarborLink - Buffalo Wild Wings
        All User Profile     : milkyway
  3. Find the profile you want to export.  In this example, we're going to export my home profile, "milkyway" to a folder on the thumb drive, F:\wirelessconfig.
  4. Type netsh wlan export profile name="milkyway" folder="F:\wirelessconfig" key=clear and press [ENTER].
  5. Take the USB stick to the target computer and plug it in.  Note the drive letter.
  6. Open an elevated command prompt.
  7. Type netsh wlan add profile filename="F:\wirelessconfig\Wireless Network Connection-milkyway.xml" and press [ENTER].

Monday, July 23, 2012

Office365 Migrations and the legacyExchangeDN

I ran across this problem for a customer and thought I would share my experience/resolution.

Migration Scenario:
- Customer runs Exchange 2003 environment and RPC/HTTP is non-functional for the migration
- Using 3rd-party tools to migrate accounts
- When an internal user replies to messages from another internal user prior to migration, the sender receives an NDR with the X400 address of the legacy Exchange system

Tools required:
- ADFind (joeware.net)
- Microsoft Online Services PowerShell Module
- Text editor

1.     Run ADFIND on the customer's server.  This is the syntax I used:
adfind -csv -h -b "" -f "objectClass=user" -nodn mail legacyexchangedn > userlist.csv

2.     Clean up the email addresses in the userlist.csv file (to make sure they match the Office 365 addresses).
3.     Connect to the Office 365 tenant using PowerShell.
4.     Run the following script:

$csv = import-csv .\userlist.csv -header Username
foreach ($line in $csv)
    {   
    $user=Get-Mailbox -Identity $line.Username
    $user.EmailAddresses+="X500:"+$line.legacyExchangeDN
    Set-Mailbox -Identity $line.Username -EmailAddresses $user.EmailAddresses
    }


Let me know if this helped you out by leaving a comment.

Cheers.

Wednesday, May 23, 2012

Office 365 DirSync Setup Error 1603

During your journey of Office 365 nirvana, you may decide to install DirSync (or, as the setup window title more verbosely describes it, "Microsoft Online Services Directory Synchronization"). So, you spin up a new Windows Server 2008 R2 VM, join it to your domain, and, start the setup.

And then it happens.

ErrorCoexistence MSI installation failed. msiexec returned 1603 Unable to uninstall the Microsoft Online Services Directory Synchronization tool. Use the Control Panel to remove the Directory Synchronization tool.

What the heck?

Oh, you must have forgotten to install the .NET Framework 3.5.1 Features feature.  How silly of you.

You know what to do.

More MD3000i Trickery

Tonight I found myself recovering a VM on a Windows 2008 R2 cluster connected to an MD3000i SAN.  To make very long and painful story short, it appears that someone applied a series of Windows Updates and then a Dell DSM update that screwed up the multipathing.

In the end, I resorted to breaking the cluster and then mounting the LUNs.  Most of the VMs I kept on one server, but I wanted to move a handful to what used to be the other node of the cluster.  However, when reassigning the LUN in the MD Client to another host, I received an error that there was already a persistent reservation on the volume and that I should talk to my administrator.

In order to free the SCSI-3 reservation on the LUN, I had to run this command:

smcli -n -c "clear virtualDisk [\"virtualDiskName\"] reservations

After that, I was able to successfully re-assign the LUN.

Monday, April 2, 2012

Quick-n-Dirty User Management for Office 365 Hybrid Deployments

Over the past several months, we have deployed Office 365 to dozens of organizations. Several of the larger environments have asked for integration between the on-premise Active Directory environment and the Office 365 environment. For this, Microsoft has provided a roadmap using Active Directory Federation Services (ADFS) and Directory Synchronization (DirSync). This is a great solution for end users, but can be onerous for the system administrator--especially if the customer has been migrated from Exchange 2003.

When running in any sort of Hybrid mode (or having transitioned from Exchange 2003 on-premise), there are two attributes that need to be updated/maintained with the on-premise AD in order to keep things moving along:

- proxyAddresses
- targetAddress

The proxyAddresses multi-valued attribute is used to store all of the various addresses that are bound to a user. These include (but are not limited to) SMTP and X.400 addresses. In an on-premise Exchange environment, this attribute is used to store the addresses assigned by various recipient policies.

The targetAddress attribute stores the unique "onmicrosoft.com" address assigned to each user. During a transition, mail intended for the @domain.com address skips local mailbox delivery and is automatically forwarded to the address stored in this attribute. If the local Exchange server is kept on-line for local SMTP routing, these attributes *must* be populated for each new user, otherwise mail delivery to them from on-premise services utilizing the Exchange environment will fail.

To work around this, I've put together a very low-end script utilizing the Quest ActiveRoles cmdlets. You will need to install these on either a workstation or server in your environment and then then save the follwing script as a .ps1 file (replacing the placeholders with your own) on the same computer where you have installed the ActiveRoles PowerShell environment.

Write-Host "Please enter the Active Directory ID of the user to update:"
$SamID = Read-Host
$PrimaryDomain = "domain.com"
$SecondaryDomain = "domain2.com"
$Office365Domain = "domain.onmicrosoft.com"

Get-QADuser $SamID Set-QADUser -ObjectAttributes @{targetaddress="SMTP$SamID@$Office365Domain"}
Get-QADUser $SamID Add-QADProxyAddress -Address $SamID@PrimaryDomain -Primary
Get-QADUser $SamID Add-QADProxyAddress -Address $SamID@SecondaryDomain
Get-QADUser $SamID Add-QADProxyAddress -Address $SamID@Office365Domain

Tuesday, February 7, 2012

Boot from VHD is Wicked Awesome

Boot from VHD is a great technology that enables you to host multiple self-contained operating systems on a single hard drive. Similar to dual-booting, but you don't have to worry about installing applications over each other or overwriting program file updates because your secondary OS is fully contained within a single virtual hard disk file.

As someone who spends a lot of time at customer sites, I find this invaluable to maintaining a clean, portable secondary environment. My boot-from-vhd enviornment can be joined/disjoined from customer domains without affecting my corporate laptop build; I can run beta apps and install troubleshooting tools without jeopardizing the stability of my daily work computer.

For my installation, I'm using Windows 7 Ultimate as my primary host computer and will install Windows 2008 R2 inside my VM environment.

Requirements:
- Windows Automated Install Kit (necessary for ImageX)
- Windows 2008 R2 Physical Media (or ISO + utility such as Virtual CloneDrive to mount it)

Now, some of you will probaby grumble about needing to download the whole 1.3GB+ WAIK package for less than 1MB of software necessary to perform this task. It does seem ridiculous, that Microsoft has not made it available separately for this specific purpose (and, since WAIK is a free download, most people don't see why you can't just get the tools you need out of it). If you search around, you can find the ImageX pieces available, such as here or here.

If you want to install just the ImageX componets, you need:
- imagex.exe
- intlcfg.exe
- vsp1cln.exe
- wimfltr.inf
- wimfltr.sys
- wimgapi.dll

Extract the files from such a download to C:\Windows\System32; copy wimfltr.sys to C:\Windows\System32\drivers, and then right-click > Install on wimfltr.inf.

Alternatively, download and install WAIK.

Moving on ...

Create a Directory to Store VHDs
  1. From Windows Explorer, create a new directory (I used C:\VHD).
  2. Yep, that's it.

Create a VHD
  1. On the start menu, click Start, type in cmd, and then press Ctrl+Shift+Enter to start an Elevated Command Prompt. right-click Computer, and then click Manage.
  2. In the User Account Control dialog box, click Yes.
  3. Type compmgmt.msc and press Enter.
  4. In the left pane of the Computer Management console, click Disk Management.
  5. In the right pane, click More Actions, and then click Create VHD.
  6. On the Create and attach Virtual Hard Disk page, specify the location as C:\VHD\Windows2008R2.vhd, the virtual hard disk size as at 50GB, and then set the virtual hard disk format to Fixed or Dynamically expanding (depending on your preference). If it's not something you're going to use often, you can use a Dynamically Expanding VHD to save space. If you choose Fixed, you're going to have to wait for the entire 50GB (or whatever size file it is) VHD to be formatted.
  7. Click OK.
  8. In Disk Management, right-click the newly-created 50 GB disk, and then select Initialize Disk.
  9. On the Initialize Disk page, verify that the VHD is selected. Choose MBR as the partition style, and then click OK.
  10. Once the disk is initialized, right-click the unallocated space of the disk, and then select New Simple Volume.
  11. When the Welcome to the New Simple Volume Wizard starts, click Next.
  12. On the Specify Volume Size page, leave the default values to use the entire disk, and then click Next.
  13. In the Assign Drive Letter or Path list, choose an unused drive letter (I chose V:), and then click Next.
  14. Under Format this volume with the following settings, specify NTFS for the file system, use the default Allocation unit size, specify a volume name Next.
  15. On the Completing the New Simple Volume Wizard page, click Finish.

Mount the Windows Server 2008 R2 Media (If Necessary)

This example uses Slysoft Virtual CloneDrive

  1. Navigate to the folder where you have downloaded the Windows 2008 R2 media.
  2. Right-click the ISO file, and then select Mount (Virtual CloneDrive E:), where E: is the virtual DVD-ROM letter. Mine just so happens to be E:.

Apply the Windows Server 2008 R2 Image to the VHD

  1. Go back to your Elevated Command Prompt (or launch a new one).
  2. Run the following command to determine which Windows Server edition you wish to use:
    dism /Get-Wiminfo /Wimfile:"E:\Sources\install.wim"
  3. Select an index number that corresponds to the edition that you wish to install. In my case, I chose Index 3.
  4. Run the following command to apply the installation image in the appropriate index to the VHD that is currently mounted as V:\:
    imagex /apply "E:\Sources\install.wim" 3 v:

Update the Boot Configuration Data

We'll use BCDEdit /copy to use the current boot configuration entry as the starting point for our new entry.

  1. Run the following command from your Elevated Command Prompt:
    bcdedit /copy {current} /d "Windows 2008 R2 VHD Boot"
  2. Copy the newly-created GUID to the clipboard.
  3. Run the following commands (using the new GUID) to instruct the Boot Manager where to look for the VHD:
    bcdedit /set {enter-new-GUID-here} device vhd="[locate]\VHD\Windows2008R2.vhd”
    bcdedit /set {enter-new-GUID-here} osdevice vhd="[locate]\VHD\Windows2008R2.vhd”
  4. Run the following command to force hardware detection during the initial boot:
    bcdedit /set {enter-new-GUID-here} detecthal yes
  5. Close the elevated command prompt.

Detach VHD

  1. In Disk Management, right-click the disk that is the mounted VHD, and then click Detach VHD.
  2. On the Detach Virtual Hard Disk page, ensure that the Delete the virtual hard disk file after removing the disk check box is NOT selected, and then click OK.
  3. Close the Computer Management console.

Monday, November 21, 2011

Copy Cisco Disk Image via FTP

Tonight, I found myself having to copy the AnyConnect binaries from one ASA 5505 to another without a device on-LAN to TFTP to. I did, however, have a public FTP server that could use to move the data around.

This feature seems to be relatively un-discussed, so here is the syntax.

ASA/Router Binary: my-win-package-k9.pkg
FTP Server: ftp.myserver.com
FTP Server User Name: aarong
FTP Server Password: password1

copy disk0:my-win-package-k9.pkg ftp://aarong:password1@ftp.myserver.com/my-win-package-k9.pkg

Yes, it's really that simple. Would have been nice if someone told me.

Thursday, September 22, 2011

The Underbelly of Economics No One Talks About

It's the economy, stupid.

Truer words have never been spoken in a political context.

I find it unfortunate that both political parties spend more time in demagoguery than speaking the truth that will set the U.S. economy free. There are a few principles that I'd like to soapbox about for a few minutes:

  1. Supply and demand. It's the basis of capitalism--more demand than supply causes prices to go up; more supply than demand causes the inverse. Scarcity and price are in lock-step. Relatively simple on the whole; it, unfortunately, lends itself to monopoly and supply manipulation (for example--oil companies. They can single-handedly control how much their product costs and their profit margin by artificially restricting supply).
  2. Competition. Another cornerstone of capitalism is competition--more people making the same thing drives the price down; fewer providers of said good or service causes the price to go up.
  3. Productivity. This is the differentiating factor between companies providing the same product or service--the more productive a company's workforce, the lower it can price its product or service (see #2) and use that price advantage to gain marketshare.
  4. Investment. Money used for the development and growth of a company can be spent in a few different areas, such as: equipment (computers, desks, chairs, machinery), facilities (buildings or building improvements, land), labor (employees or contractors), research and development, or marketing.
  5. Taxes. They make the world go round; they're the bane of business and wage-earner alike.
That's really the foundation of our economy. Or is it?
The debate over taxes and the effectiveness of economic stimulus has reached the point where neither side has any new information to add--they just keep repeating the same talking points over and over again, hoping that their arguments will eventually wear someone down into agreeing with them.
That being said, I'd like to start off with my take on how our economy works.
In our credit-based economy, corporations utilize a variety of private investment capital, stock issues, and loans to do everything from acquire inventory to pay salaries. According to monetarists, managing the interest rates on borrowing and the total money supply is the key to managing the speed of economic growth. Higher interest rates and less money in the economy means it costs more to borrow and invest in and grow the company; lower interest rates mean it's cheaper to borrow money in an attempt to grow the company or cover day-to-day expenses.
The Federal Reserve Board controls this core interest rate. As William McChesney Martin, the longest-serving and most notable Federal Reserve Chairman once said, the job of the Federal Reserve is to "take away the punch bowl just as the party gets going," meaning, that raising interest rates and tightening the money supply is necessary in a robustly-growing economy to help prevent bubbles and unsustainable growth.
Martin knew a thing or two about how money worked--he became a partner at A.G. Edwards after having only worked there two years and earned himself a seat at the NYSE. Having studied economics at Columbia for 6 years and been president of NYSE, he understood exactly how capital markets functioned and how to keep an even keel on business.
With those concepts in mind, managing interest rates and money supply are traditionally the only tools that the Federal Reserve has to be able to manipulate the economy (policies such as quantitative easing will be put in the parking lot for the purposes of this discussion).
The problem that our economy now faces is bigger than managing interest rates. If monetary policy was really the cure to economic woes, certainly lowering the interest rate to 0% would cause companies to borrow and invest like gangbusters, since they would have all this free money. Unfortunately, we've seen that monetary policy alone cannot bring a country out of a recession.
Many people credit Roosevelt's Keynes-influenced New Deal with infusing the U.S. economy with enough money to grow out of the problem. While many economists debate whether it's true or not, I think there's strong evidence to support that thought (at least in part).
In current political dogma, Democrats think in Keynesian terms--by injecting massive amounts of cash into public works projects, the government can drive up employment, which will turn the unemployment-collectors into taxpayers. Republicans think in Reaganomic or supply-side terms--that lowering the tax burden on the wealthy and corporations will cause them to spontaneously start investing and hiring more people.
Critics of the Democratic policies point to Obama's stimulus as "failed," proclaiming that hundreds of billions of dollars were spent to achieve minimal growth and have incurred large deficits along the way. Defenders of the stimulus plan point to reports that millions of jobs were at a minimum, saved, and that it sped up economic recovery.
Critics of supply-side economics (such as myself) will point to the fact that income and investment taxes are at their lowest level in decades and that the Fed has set the funds rate near 0% (it's been there for nearly 3 years), and we are still having massive unemployment problems. Defenders of those policies say that we haven't cut taxes to the point where it incents employers to create jobs.
I personally believe that the stimulus package, while large, was not large enough. A good portion of it was actually diverted into investments in Chrysler and GM, which staved off an enormous crisis. I think what we really needed (and still do) is an influx of around a trillion dollars. Most economists believe that, at its best, our economy was flourishing with about a 4.5-5% unemployment rate. In Keynesian economic thought, the stimilus should be big enough to simulate economic output of our nation operating at an optimal unemployment rate. In layman's terms:
Consider our country as having 100 citizens. At our peak output, 95 of them are employed making $1,000 per year, and 5% of them are unemployed. Then, at some point, disaster strikes, and our employment goes to 10%. We now have 90 people making $1,000 per year. The result is that there are 5% fewer people to buy the goods and services we are producing, which leads to fewer products being sold and eventually, layoffs. In Keynesian terms, we would need a stimulus package of at least $5,000 to put that 5% of people back into the labor force and both producing and consuming goods. The world is back at equilibrium.
While that's an overly simplistic view, it illustrates how Keynesian economic theory works. The problem that most economists see with the previous stimulus package is that it wasn't enough to drive the employment of the extra 3 or 4% of the unemployed labor force. Instead, a smaller bill was passed--it may have softened the blow, but we still got hit with a sledgehammer.
Of course, Republicans (and Tea Partiers, in particular) point to the fact that $800bn was spent for nominal effect; Democrats say that it was like a bandaid on an amputation--too little too late.
In order to jump start the economy, Republicans continue the supply-side economic mantra--lowering taxes will create jobs. The problem is the same one that the Fed is having with its monetary policy--the rates are low, but it's not causing investment.
I think that we could have near zero taxes and still not create a meaningful amount of jobs. The problem that we're in now is that we have a workforce fearful of losing their jobs. Corporations have discovered this fear, and have piled more and more work on their employees while cutting pay and benefits. Employees are now working harder for less, driving up productivity and adding to the company's bottom line. As long as companies can continue to squeeze work out of their existing labor force through fear, there's not going to be a meaningful positive change in unemployment.
I believe that the only way out of this downward spiral is a truly massive influx of cash into public sector employment (especially infrastructure) to drive demand for other goods and services to a level that companies are forced to hire more workers to meet that demand. Getting the unemployment down a few points by itself isn't enough--it needs to be large enough to cause us to exceed our current economic output capacity, which will then cause the private sector to create jobs to meet that demand. Employers aren't going to create jobs until they know there will be a sustainable demand for their products and services.
The large anti-government crowd are naive pawns being used by conservative politicians to promote a lower-tax agenda. Unfortunately, most of us will never make the kind of money to be impacted one way or another by increasing the marginal tax rate on income over $1,000,000 or raising the capital gains tax. The trickle-down economic policies don't work--the rich keep their wealth or move it overseas to avoid being taxed; they don't create jobs with it.
In the end, we need a balanced approach--something that neither side of our polarized political system is interested in pursuing.

Wednesday, August 24, 2011

Set "Password Never Expires" for Microsoft BPOS Standard Accounts

Cries of joy are ringing throughout the Microsoft BPOS Partner community--the ability to set "Password Never Expires" for BPOS Standard Accounts has *finally* been released. Previously available only for BPOS-D customers, Microsoft has ported the command to the newest update of the Microsft Online Services Migration Tools (available for x86 here and x64 here).

So, once you've downloaded and installed the updated tools, how do you avail yourself of this helpful feature?

Set "Password Never Expires" for All Enabled Users
1. Open Migration Command Shell.
2. Copy/paste the following commands:

$cred = Get-Credential
Get-MSOnlineUser -enabled -Credential $cred | Set-MSOnlineUserPasswordNeverExpire -Credential $cred -PasswordNeverExpire $true

Drop in your BPOS administrative credentials (in the form of user@domain.com and password) in the pop-up dialog box when prompted.