Networking via PowerShell

by Ed Sparks

PowerShell is clearly the way forward at Microsoft, particularly as more workloads are moved to the Azure cloud.  Learning the language of POSH, as it's colloquially become known, is definitely one of the best investments in time an administrator can make.  It always amazes me how powerful and consistent this language is compared to the multitude of obscure and non-standard tools of the past.

A great example is replacements for our old friends ping, tracert, ipconfig and the like.

There's a great article on Technet that describes some of the more useful and common ones.

Go forth and Get-NetIPConfiguration today!

ISO CA US UK - the PowerShell Active Directory Country Gotcha

by Ed Sparks

While writing some PowerShell scripts to update a few Active Directory fields en-masse, we discovered a distinct lack of documentation on updating address information; particularly the country field.

While it appears these fields would be free-form text (as they are when editing through AD GUI tools), through PowerShell they are actually normalized and must be in the ISO Country Code format!

So, using "Canada" as a country will not work.  Rather you must use CA.  Which isn't California.

Failing to use one of the ISO codes will result in PowerShell throwing invalid errors when it writes the AD object.

Here is a list of the ISO country codes.
 

Here is a good Technet script for copying AD properties, as well.