$PSModuleAutoLoadingPreference and You

This is a very simple onelner.  The problem statement is a more complicated. PSH 3 and 4 treat PSModules in a very funny way.  These versions have a default module path, and will return any cmdlet that happens to be in any module that happens to be in any directory in the default module path,…

0

Filtering Show-NetIPSec Rules based on IP Address

Get-NetIPSecRule seems a little half-baked.  A coworker asked me to come up with a way to only return IPsec rules for a given address.  I’m surprised Show-NetIPSecRule natively doesn’t have that, nor does each record have the RemoteAddress property, which would be against which I would filter.  I’m not sure I understand the design decisions…

0

Getting Trusted Domain Computer Names

The -replace ‘\..*’, $domain snippet is in case here’s some AD funkiness that returns the FQDN from the external DNS record instead of internal. Some of my labs expose machines to other labs. Dammit, Jim, I’m a lab admin, not the DNS guru. function Get-ComputerNameFromTrustedDomain { if (!(Get-Command -Name Get-ADObject)) { Import-Module ServerManager; Add-WindowsFeature RSAT;…

0

Importing Azure RDC Files into RDCMan.exe’s RDG

This is really over-engineering.  Azure’s “connect” link sends you a .rdc file to download or open.  The registered handler for .rdc files is mstsc.exe, a.k.a. Remote Desktop Connection. The key line in the .rdc file is “Full Address:s:FQDN:PORT”.  The ‘s’ column in the colon-delimited value is short for ‘string,’ nothing more.  What we want are…

0

Namespaces, Why Does It Always Have To Be Namespaces?

I’ll be honest, I LOATHE namespaces in XML.  I haven’t seen a case where I needed to use them to differentiate between identically-named elements in different contexts.  So often, the document declares a namespace at the top and never overrides it.  In that case, why use it? Why do I hate it? It breaks XPath…

0

Backing Up BitLocker Recover Key (Strikes Again!)

Here’s a one-liner for backing up the BitLocker Recovery Key for every drive attached to the machine: ZgB1AG4AYwB0AGkAbwBuACAAQgBhAGMAawB1AHAALQBCAGkAdABMAG8AYwBrAGUAcgBSAGUAYw… Followed by 9kb of more of the same.  It’s an EncodedCommand, so we can toss this into a scheduled task.  The actual encoded command is attached (thank goodness!) It outputs a .CLIXML file that contains a scalar…

0

BitLocker and Voice

I loathe BitLocker.  In fact, I often let a ‘ch’ phoneme slip in between the first and second vowel.  The reason is that it seems to be on some random hair-trigger.  Patching will trigger Recovery Mode.  Sometimes even having a USB HD or memory stick attached will trigger it.  I have a Surface Pro, in…

0

SkyDrive, OneDrive, Let’s Call the Whole Thing Off

(Apologies to Istanbul (Not Constantinople) by Jimmy Kennedy and Nat Simon.) We all know about SkyDrive being renamed OneDrive.  However, I don’t see a way to determine which is where on what machine.  Rather than dive through the registry for that, I decided to normalize my scripts to OneDrive, and to create symlinks from SkyDrive…

0

$PSBoundParameters and CommonParameters (-WhatIf, -Debug, etc.)

For the longest time, I was unable to get $PSBoundParameters to work to detect –Debug, -Verbose, etc. CommonParameters. Here’s a handy page that captures the output of about_CommonParameters. http://technet.microsoft.com/en-us/library/hh847884.aspx

0