Sunday, May 3, 2015

98% As Good As Sex Chocolate Chip Cookies


Because if they were better than sex, you're doing sex wrong.


Ingredients
2 1/2 C + 2TBSP all-purpose flour
3/4 C granulated white sugar
3/4 C packed brown sugar
7 oz. semi-sweet chocolate chips
7 oz. dark chocolate chips
1/2 C butter-flavored Crisco
1/2 C + 1 TBSP I Can't Believe It's Not Butter Margarine
1 TBSP milk
1 TBSP vanilla extract
1/2 C finely chopped pec
1 tsp baking soda
1/2 tsp salt
3 TBSP Egg beaters / egg whites (or 1 large egg)

Tools
Digital Scale
Ice Cream Scoop or large spoon
Non-stick cookie sheet
Parchment paper
Nylon spatula
 
1.      Pre-heat oven to 375 degrees.
2.      Sift all dry ingredients together except chocolate chips.
3.      In a stand mixing bowl, mix all wet ingredients, and then slowly pour in dry ingredients.
4.      Stir in chocolate chips with a wooden spoon.
5.      Using an ice cream scoop, measure out approximately 80g of dough.  Making them within 5g of each other ensures even baking time.  Should make 16 cookies, taking “nibbling” into consideration.
6.      Place dough in balls approximately 2 1/2 inches apart on tray.
7.      Bake for 9 minutes; remove from oven and let sit on sheet for an additional 2 minutes before transferring to parchment paper with a nylon spatula.

Thursday, February 20, 2014

The *real* math behind the beer tab tax comparison

I wrote this a while ago for a Facebook post a few years ago as a reply on some vitriol spewed by Glenn Back, basically regurgitating the beer tab analogy to our tax system.

-----

Too bad Mr. Beck (along with most of the world) doesn't understand how progressive taxes really work, and how the American tax system in particular works.  There are some key facts that he has elected to leave out.  But before we get to what's missing from Beck's mischaracterization of taxes, a quick primer on the American progressive taxation system.

There are five main different systems of taxes in the US: sales taxes, payroll taxes, income taxes (standard and the alternative minimum tax), and capital gains taxes:

Sales Tax

Pretty easy.  It's a flat tax determined by your state and applied to products that you purchase. It's consumption based and regressive.  Consumption meaning, you pay it on the things you purchase or consume; regressive meaning that it disproportionally affects those with lower incomes.  The only method to legally avoid this tax is not to buy stuff.  In most states, unprepared food (groceries) is exempt from sales tax, while prepared food (restaurants) is not.
 
Payroll taxes 

Wage earners pay these.  It's your combined Social Security and Medicare tax. The current rates are 4.2% for SS tax (up to the first $110,100 of earned income) and 1.45% for Medicare (no earned income limit).  These taxes only applies to wages, not to investment or dividend income.
 
Income Taxes
This is the most complex of the taxes.  The standard tax is currently divided into 6 brackets for two filing statuses: Married Filing Jointly (MFJ) and Single (S):
 
Bracket, Income range for MFJ, Income range for S
10%, $0-$17,400, $0-$8,700
15%, $17,400-$70,700, $8,700-$35,350
25%, $70,700-$142,700, $35,350-$85,650
28%, $142,700-$217,450, $85,650-$178,650
33%, $217,450-$388,350, $178,650-$388,350
35%, Over $388,350, Over $388,350

The AMT is a lot more complicated and applies to about 4% of US households in a given tax year and kicks in around $175,000 (give or take), and is always a moving target because Congress changes the income threshhold.  Since it applies to such a small portion of people, we're going to ignore it for this discussion and treat those people like normal tax payers.

Captial Gains tax
Taxes on investment income (dividends, sales of stocks/bonds).  It is currently 10% or 15%, depending on qualifying investments and such.

As to the parts that Beck (and other commentators) either doesn't know or conveniently leaves out:

  1. Everyone pays taxes (depsite the claims that half the population doesn't pay any).  They may, however, get rebates and deductions that make their overall tax liability zero, but before those get applied, everyone pays taxes.  One of those credits for lower-income and middle-income earners is the Earned Income Tax Credit, the expanse of which championed by the patron saint of the Republican Party, Ronald Reagan in the Tax Reform Act of 1986.
  2. Everyone pays the same rates on their earned portion of income.
  3. When politicians are talking about "the rich pay less taxes" or "making everyone pay their fair share," they're not talking about income derived from salaries or wages.  What they're talking about is the primary source of income for the wealthy--investments.  If you have an income of $400,000 per year, and you receive that income as wages, you'll pay something in each of the six tax brackets.  If that income comes from investments, you're going to be paying the 10% or 15% rates.
So, let's take a look at three individuals, and assume that neither have any deductions or exemptions (because this is an FB post and they have limits.  Also, I'm not an accountant or tax professional, so I'm not going to run really complicated numbers). 

Individual 1 is a Joint filer with a salary of $84,000.  Individual 2 is an investor whose $168,000 income came solely from sales of his long term stock holdings.  Individual 3 is a "high-income wage earner," with wages of $400,000.
 Individual 1's tax liability looks like this:
Income (Salary) $84,000
FICA (4.2%), -$3,528 ($84,000 * 4.2%)
10% Bracket, -$1,740 ($17,400 cap * 10%)
15% Bracket, -$7,955 (($70,700 minus first $17,400) * 15%)
25% Bracket, -$3,325 (($84,000 minus first $70,700) * 25%))
Total liability: $16,548 on a total income of $84,000, or 19% of Individual 1's income is taxed
 Individual 2's tax liability looks like this:
Income (sale of stocks) $168,000
FICA (4.2%), $0 (only applies to earned income)
n% Bracket, $0 (only applies to earned income)
10% Capital gains liability, $16,800
Total liability: $16,800 on an income of $168,000, or 10% of Individual 2's income

In this example, Individual 2 had *twice* as much income and was taxed only $452 more (or paid half as much tax proportional to their income).
 Individual 3's tax liability looks like this:
Income (Salary) $400,000
FICA - SS (4.2%), -$4,624.20 ($110,100 * 4.2%)
FICA - Medicare (1.45), -$4,203.55 (($400,000 minus $110,100) * 1.45%)
10% Bracket, -$1,740 ($17,400 cap * 10%)
15% Bracket, -$7,955 (($70,700 minus first $17,400) * 15%)
25% Bracket, -$18,000 (($142,700 minus first $70,700) * 25%)
28% Bracket, -$20,930 (($217,450 minus first $142,700) * 28%)
33% Bracket, -$56,397  (($388,350 minus first $217,450) * 33%)
35% Bracket, -$4,077.50 (($400,000 minus first $388,350) * 35%)
Total liability: $117,927.25 on an income of $400,000, or 29.5% of Individual 3's income

As you can see, the tax system is unfairly weighted against wage-earners (as opposed to people who derive their income from investments).  Why should one type of income be "preferred" over another?  Individual 2 gets a pretty sweet deal in this case.  Individual 2 wouldn't pay the same dollar amount in taxes as individual 3 until he gets to $1.17 million in income (he'd be paying the same 10% capital gains tax).  When Democrats are talking about the wealthy paying their "fair share," *this* is what they're talking about, not some silly math on a beer tab.

If we took Glenn's beer tab example and applied the US's real wage distribution against it, it would look dramatically different.  According to the Tax Foundation (http://taxfoundation.org/article/summary-latest-federal-individual-income-tax-data-0#table1), I think it would look more like this:
 1 - $2.30
 2 - $2.30
 3 - $2.30
 4 - $2.30
 5 - $2.30
 6 - $19.18
 7 - $19.18
 8 - $19.18
 9 - $19.18
10 - $11.80

That being said, persons 6-9 (who represent the 50th through 99th percentile or the middle class) pay 75% of the bill, while the bottom 50% and the top 1% pay roughly the same percentage.

In other terms, 40% of the people pay 75% of the bill, and 60% of the people pay 25% of the bill.  Not terribly fair.

Saturday, January 25, 2014

Flaky, Chewy Brownies

This morning, I had a craving for brownies.  Like 1am craving.  What's a guy to do when this urge hits and the normal ingredients (a.k.a. "the box") aren't available?

Improvise.  And make the best damn brownies ever.

Ingredients
  • 12 oz semi-sweet chocolate chips
  • 1 stick unsalted butter
  • 1/2C + 2 T solid coconut oil
  • 1/2 tsp salt
  • 4 eggs
  • 2 tsp vanilla
  • 2 1/2C powdered/confectioner's sugar
  • 1 1/4C all-purpose flour
  • 1 T water
  • Baking spray (non-stick spray with flour)
Equipment
  • Wire whisk
  • Large mixing bowl
  • Rubber spatula
  • One 9"x11" or two 8"x6" glass baking dishes
Preparation
  1. Pre-heat oven to 325 degrees F.
  2. Grease with the baking spray.
  3. In a medium Teflon saucepan, begin heating the chocolate chips, butter, and coconut oil, stirring occasionally.
  4. In a large mixing bowl, beat all four eggs, vanilla, and water with a whisk. Fold in the powdered sugar and salt.
  5. Remember to stir the chocolate chips.
  6. Continue stirring the batter.  Add in the flour.
  7. Remove the melted mixture from heat.
  8. Stir the egg and flour mixture until it's as smooth as it can be, until your hand hurts, or for about 2 minutes.
  9. Slowly add the melted chocolate chip mixture to the mixing bowl.
  10. Stir some more until the mixture is smooth.
  11. Pour the batter into the baking dish(es) and place them in the oven.
  12. Set the timer for 25 minutes and grab a Disaronno.
  13. At the 25 minute mark, stick a wooden toothpick, chopstick, or skewer in.  If it comes out super-gooey, add another two minutes.
  14. Lather, rinse, repeat, but don't get any soap in the brownies, because that will suck.
  15. When the wooden insertion tool comes out mostly clean (not all the way clean--it's kind of an art at this point), take the brownies out of the oven and set on a wire rack to cool.
Consummation
  1. Once they've cooled so you can cut them, do so.
  2. Pour a cold glass of milk.  Rum optional.

Monday, September 16, 2013

Copy attribute from one field to another with PowerShell

This week, while prepping two different customers for single-signon to Office 365, I ran into the same issue--the userPrincipalName attribute was correctly populated (username@domain.com), but the email address was blank.  So, to rectify this problem, I put together a script that reads the UPN attribute and then copies to the the mail attribute.

Leave me a comment if you find it useful!

# Populate "mail" attribute with UPN
Import-Module ActiveDirectory

Get-ADUser -LDAPFilter '(userPrincipalName=*)' `
-Properties userPrincipalName,mail | Select-Object * | `
ForEach-Object { Set-ADObject -Identity `
$_.DistinguishedName -Replace `
@{mail=$($_.userPrincipalName)} }
 
 

Tuesday, August 6, 2013

Managing via WinRM

What is WinRM?

WinRM, for those of you not in the know, is really the Microsoft answer to an age-old problem in the Windows world--remote command and task execution.  It's the Windows equivalent of the Unix rsh, a native implementation of the PsExec (albeit, with the added complexity that seeps into nearly all Microsoft technologes).  It's built on SOAP, so it's intended to be firewall-friendly.

The quick guide to enabling it:

On a server you wish to enable WinRM managment, open an elevated command or PowerShell prompt and run winrm quickconfig.  Answer "Yes" to create the listener and open the necessary ports in the Windows Firewall.

Once that's done, you may need to set the configuration to allow you to connect to it and issue remote commands.  You can do this by by opening an elevated command or PowerShell prompt and entering one of the following command examples:

Add a single trusted remote management host

winrm set winrm/config/client '@{TrustedHosts="server1"}'

Add multiple trusted remote management hosts

winrm set winrm/config/client '@{TrustedHosts="server1,server2"}'

Make every host trusted (not advised)

winrm set winrm/config/client '@{TrustedHosts="*"}'

Now What?

Let's say you want to execute a command against a WinRM host.  To do this, use the command winrs.

For example, to open a command prompt on server2, you would run:

winrs -r:server2 cmd

For a whole bunch of other stuff you can do with WinRM, please see the following (much more technical) articles:

http://blogs.technet.com/b/otto/archive/2007/02/09/sample-vista-ws-man-winrm-commands.aspx
http://blogs.dirteam.com/blogs/sanderberkouwer/archive/2008/02/23/remotely-managing-your-server-core-using-winrm-and-winrs.aspx
http://technet.microsoft.com/en-us/library/dd163506.aspx

Happy remoting!

Tuesday, April 23, 2013

Handy Office 365 PowerShell Cmdlets

Here are some handy Cmdlets that you may find useful when managing Office 365.

- Connect to the Microsoft Online Services interface for account management tasks.
import-module MSOnline
$cred = Get-Credential
Connect-MSOLService -credential $cred


- Connect to the Microsoft Exchange Online interface for Exchange-related tasks.
$cred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri
https://ps.outlook.com/powershell -Credential $cred -Authentication Basic -AllowRedirection
Import-PSSession $Session


- Set Office 365 passwords for all accounts to P@ssword1 and clear Change Password Flag (not valid for ADFS customers)
Get-MsolUser | Set-MsolUser -NewPassword P@ssword1 -ForceChangePassword $False

- Set Office 365 passwords for all accounts to never expire (not valid for ADFS customers)
Get-MsolUser | Set-MsolUser -PasswordNeverExpires $True

- Set Time Zone to Eastern Time and Language to English (US) for all users
get-mailbox -Filter {RecipientTypeDetails -eq 'UserMailbox'} | Set-MailboxRegionalConfiguration -Language "en-US" -TimeZone "Eastern Standard Time" -DateFormat "M/d/yyyy" -TimeFormat "h:mm tt"

- Get a user's mailbox permissions on a selected mailbox
Get-MailboxPermission -Identity <mailbox@domain.com> | Where {_.User -like '*user*'}
Get-RecipeintPermission -Identity <
mailbox@domain.com> | Where {_.Trustee -like '*user*'}

- Get a list of Directly-granted rights, excluding "SELF"
Get-Mailbox | Get-MailboxPermission | Where-Object { ($_.AccessRights -like '*full*') -and ($_.IsInherited -eq $false) -and -not ($_.User -like '*nt authority\self*') }
Get-Mailbox | Get-RecipientPermission | Where-Object { ($_.AccessRights -like '*send*') -and ($_.IsInherited -eq $false) -and -not ($_.User -like '*nt authority\self*') }


- Set Shared Mailbox quota at 4.5GB
Get-Mailbox -RecipientTypeDetails SharedMailbox | Set-Mailbox -ProhibitSendQuota 4500MB -ProhibitSendReceiveQuota 5000mb -IssueWarningQuota 4400mb

- Get Distribution Group Members
$Reports=@()
$Groups=Get-DistributionGroup
$Groups| foreach {
 $GroupName=$_.DisplayName
 $Report=Get-distributionGroupMember -identity $_.identity| select @{Name='Distribution Group'; Expression={[String]::join(";", $GroupName)}}, DisplayName, PrimarySmtpAddress
 $Reports=$Reports+$Report
 }
$Reports | Export-csv -NoType -Path .\"output.csv" -ErrorAction SilentlyContinue


- Add Alias Domain to All Mailboxes (not valid for ADFS customers)
$users = Get-Mailbox
$aliasdomain = newdomain.com
foreach ($a in $users) {$a.emailaddresses.Add("$($a.alias)@$aliasdomain")}
$users | %{Set-Mailbox $_.Identity -EmailAddresses $_.EmailAddresses}


- Set Usage Location to United States for All users
Get-MsolUser | Set-MsolUser -UsageLocation "US"

- Assign "Exchange Online Plan 1" License to All Users for organization TestOrg
Get-MsolUser | Set-MsolUserLicense -addlicenses "testorg:EXCHANGESTANDARD"

- Force Removal of deleted mailboxes from Recycle Bin
Get-MsolUser -ReturnDeletedUsers | Remove-MsolUser -RemoveFromRecycleBin -Force


- Get All User Mailbox Sizes
Get-Mailbox -Resultsize Unlimited | Get-MailboxStatistics | Select-Object DisplayName,TotalItemSize


- Convert User mailbox to Room Mailbox
Set-Mailbox -Identity ConferenceRoom -Type Room

Set-MailboxFolderPermission -Identity ConferenceRoom:\Calendar -user Default -AccessRights Author
 
Let me know if there are other tasks you might like to see demonstrated!

Thursday, April 11, 2013

Cannot create Exchange Online Migration Endpoint with Exchange 2007 Server using only NTLM Authentication

I've been battling an issue for a few days now and finally stumbled upon a workable solution via PowerShell.


Scenario

Client has an existing Exchange 2007 deployment.  The OWA instance is configured to only use NTLM authentication.  ExRCA (http://www.testexchangeconnectivity.com) comes back clean, and I can proxy log in to any mailbox on the server.

When configuring the migration endpoint through the EAC, I would receive an error that the migration endpoint could not be discovered, even after entering the credentials, server, and RPC proxy server values manually.

Solution

The solution ended up with my old friend PowerShell.  You can create migration endpoints through it using the New-MigrationEndpoint cmdlet.  The key was forcing the authentication to NTLM.

New-MigrationEndpoint -ExchangeOutlookAnywhere -Name NewEndPointName -ExchangeServer EXCHSERVER.DOMAIN.local -RpcProxyServer OWA.DOMAIN.com -Credentials (get-credential onpremiseaccount@domain.com) -EmailAddress onpremiseaccount@domain.com -SkipVerification -Authentication NTLM

Wednesday, August 29, 2012

Error uninstalling Exchange Server 2003: One or more users currently use a mailbox store on this server.

So, you're transitioning your Exchange 2003 environment to an Office 365 environment and desparately want to drop kick your Exchange 2003 server out the door.  After migrating everyone's email, you open ESM, delete all of the mailboxes and start to uninstall Exchange.  But then, this frustrating message shows up:

The component "Microsoft Exchange Messaging and Collaboration Services" cannot be assigned the action "Remove" because:
- One or more users currently use a mailbox store on this server.  These users must be moved to a mailbox store on a different server or be mail disabled before uninstalling this server.

Thanks for leaving me the fun part of trying to guess who you think still has a mailbox.

Fortunately, there's an easy way to do this.

Let's say your server name is EXCH01.

  1. Launch Active Directory Users and Computers.
  2. In the navigation pane, right-click on your domain and select Find from the context menu.
  3. In the Find Users, Contacts, and Groups window, click the Advanced tab.
  4. Click the Field button, point to User, and then select Exchange Home Server.
  5. Set the Condition field to Ends With.
  6. Enter the Exchange mailbox server you're decommissioning in the Value field (in our example, EXCH01).
  7. Click Add.
  8. Click Find Now.
  9. Once the list of users is displayed, you can right-click on the user, select Exchange Tasks, and then select Remove Exchange Attributes from the list of options.  Acknowledge the warning, and repeat for each user.
  10. Restart Exchange setup.

Monday, August 27, 2012

Re-create BITS and Windows Update Services for Windows 7

So, you had a bit of nasty malware.  You're almost back to square one, but have now found yourself in the unfortunate position of having missing services--specifically the Background Intelligent Transfer Service and Windows Update services.

Never fear.  These, too, can be recreated in the event that your System Restore points are borked.  Copy/paste the commands into an elevated command prompt.

REM Recreate Windows Update / BITS Services for Windows 7
sc create BITS DisplayName= "Background Intelligent Transfer Service" binpath= "c:\windows\system32\svchost.exe -k netsvcs" Start= delayed-auto depend= EventSystem/RpcSs
sc create wuauserv DisplayName= "Windows Update" binpath= "c:\windows\system32\svchost.exe -k netsvcs" Start= delayed-auto depend= RpcSs

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.

Wednesday, July 20, 2011

Windows XP Automatic Updates service is missing

Recently, there have been a rash of "fake antivirus" viruses and trojans floating around the internet. Two of the more frustrating issues:

- Why are all my icons hidden?
- Where the heck did my Automatic Updates service go?

- Why am I getting Windows Update Error 0x80072EFE?

The icons hidden one is fairly benign and relatively easy to resolve:
1. Open Windows Explorer.
2. Select Tools > Folder Options.
3. Select the View tab.
4. Select the Show hidden files and folders radio button and click OK.
5. From Windows Explorer, navigate to C:\.
6. Right-click on the folder "Documents and Settings" and click Properties.
7. Clear the "Hidden" checkbox.
8. When prompted, choose to apply to all subfolders and files.

As far as the Automatic Updates issue goes, it's a little trickier. These particular strains of malware do everything from unregister DLLs to removing the Windows Update service altogether. Most of the time, the solution involves one or more of the following tasks:

- Re-registering the WUAU DLLs
- Re-registering Internet Explorer DLLs
- Deleting the cached update downloads
- Resetting the cryptographic service database

Copy/paste the following script into Notepad and save it as a .bat file:

net stop wuauserv /y

net stop bits /y
net stop cryptsvc /y
ren %systemroot%\system32\catroot2 catroot2_old
rd /s /q %systemroot%\SoftwareDistribution
regsvr32 /s actxprxy.dll
regsvr32 /s atl.dll
regsvr32 /s browseui.dll
regsvr32 /s cdm.dll
regsvr32 /s cryptdlg.dll
regsvr32 /s dssenh.dll
regsvr32 /s gpkcsp.dll
regsvr32 /s initpki.dll
regsvr32 /s iuengine.dll
regsvr32 /s mshtml.dll

regsvr32 /s msxml.dll
regsvr32 /s msxml2.dll
regsvr32 /s msxml2r.dll
regsvr32 /s msxml3.dll
regsvr32 /s msxml3r.dll
regsvr32 /s msxmlr.dll
regsvr32 /s oleaut32.dll

regsvr32 /s qmgr.dll
regsvr32 /s rsaenh.dll
regsvr32 /s sccbase.dll

regsvr32 /s shdocvw.dll
regsvr32 /s slbcsp.dll
regsvr32 /s softpub.dll

regsvr32 /s urlmon.dll
regsvr32 /s wintrust.dll
regsvr32 /s wuapi.dll
regsvr32 /s wuaueng.dll
regsvr32 /s wuaueng1.dll
regsvr32 /s wuauserv.dll
regsvr32 /s wucltui.dll
regsvr32 /s wups.dll
regsvr32 /s wups2.dll
regsvr32 /s wuweb.dll

net start cryptsvc
net start bits
net start wuauserv

Run. The "Automatic Updates" service should now be visible in the Services applet.