Active Directory – Creating Install From Media dump

function Backup-ActiveDirectoryIFM { param ( [string]$IFMPath, [switch]$NoDefrag ) $errorAction = ‘stop’ $minimumFreeSpace = 0.5TB $Mode = ‘Full’ if (!$IFMPath) { $driveObject = Get-PSDrive | ? { $_.Free } | Sort-Object -Descending Free | Select-Object -First 1 if ($driveObject.Free -lt $minimumFreeSpace) { Write-Error “Drive with largest free space $($driveObject.Name): has only $([int]($driveObject.Free/1GB))GB free, which is less…

1

Converting Whitespace-Indented Output to XML

Example of taking output delimited by indents and trying to beat it into XML. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41…

0

Moving Computer AD Objects

I’m just going to toss code up here from now own. Too busy to write nicely-formatted posts. Apologies.! 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37…

0

IE, ADFS, and Overkill

I do some testing that requires I not use Active Directory Federation Services (ADFS), which is an otherwise-convenient way to authenticate me against web sites via my Active Directory token.  I used to start IE in Private Mode to do that, but it still sometimes-but-not-always redirects me to where I don’t want to go.  Using…

0

Backing Up BitLocker Keys to OneDrive as a Scheduled Task

While I can’t say I love Bitlocker, I do understand it as a requirement for any machine with corporate data.  That said, it seems quite capricious when the BitLocker gremlin decides to require the 48-digit recovery key.   I’ve taken to saving my recovery keys to OneDrive, so I can bring up the data on my…

0

Configuring the ISE

I tend to flatten my laptop about once a season. Among the other things I lose is my PowerShell_ISE customizations. They’re not many, but I miss them when I have to live without them. Fortunately, they’re all captured in my Microsoft.PowerShellISE_profile.ps1: #$PSModuleAutoLoadingPreference = ‘None’; @(     "C:\Users\timdunn\Config\PSHModules\ISESteroidsV1\ISESteroids.psd1",     "C:\Users\timdunn\Config\PSHModules\PSReadLine\PSReadline.psd1" ) | %{     if (Test-Path…

0

Left-Padding a String

I’ll be honest; .NET has more methods and classes and properties than I can shake an idiom at. In my previous blog post, I needed to left-pad a string with zeroes in order to treat it as a 32-bit binary value to [Array]::Reverse(). I also had to do the same for an 8-bit value, but…

5

Pass the CIDR, Will You?

Classless Inter-Domain Routing (e.g. 192.168.1.0/24) replaces dotted-notation netmasks (e.g. 192.168.1.0 with a subnet mask of 255.255.255.0) to do the same thing: what IP addresses are considered on-subnet (and therefore do not need to go through the default gateway) and which ones are not. In fact, both examples above are giving the same IPv4 address range,…

0

One-Liner: Left-Padding a String with Zeroes

Yesterday’s post had a little bit of sleight-of-hand involved.  For the IPv4 address to UInt64 conversion to work, each octet had to be converted into an 8-character string of ones and zeroes.  However, [convert]::ToString($int, 2) doesn’t zero pad, and this is now a string, not an Int, so I can’t use .Net’s ToString() formatting line…

0

IPv4 Addresses and CIDR Fun

Classless Inter-Domain Routing is the current way to define a subnet.  An example entry would be “192.168.1.0/24”.  What this means is that the first 24 bits of the 32 bit IPv4 address are considered ‘off the subnet.’  The last octet is considered part of the subnet.  I.e. the computer will not route traffic through the…

0