Quick post: IIS drive

  • Context:

I installed recently a SAC (Semi Annual Channel) based Windows Server and I wanted to use some IIS cmdlets to configure it.

  • Problem:

The IIS: drive didn’t mount

  • Solution:

It appears that there are actually 2 modules.

One that doesn’t mount the IIS drive: the IISAdministration module

One that does: the WebAdministration module

What’s the difference between these 2 modules?

The IISAdministration module is more recent and compatible with both Windows PowerShell and PowerShell (Core).

Advertisements

Quick post: DISM and Features on Demand (FOD)

  • Context:

I started to migrate to the 1809 Windows 10 branch and Remote Server Administration Tools (RSAT) are no longer provided as a separate patch (MSU/cab file) but as a Feature on Demand.

  • Problem:

I wanted to avoid computers downloading the package from Windows Update or the default location set by Group Policy or the Windows directory of a mounted image or a running Windows installation that is shared on the network.

  • Solution:

I downloaded the FOD ISO image and extracted just the cab files I needed.

With the following structure (yes, you need the metadata subfolder and its content + meet the package dependencies)

you can use the Add-WindowsCapability cmdlet and do:

$Source = '\\server-share\whereIextractedCabfiles'
$HT = @{
 Name ='Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0'
 Online = [switch]::Present
 LimitAccess = [switch]::Present
}
Add-WindowsCapability @HT -Source:"$($Source)"

Quick post: Windows branch downgrade

  • Context:

We started testing the Windows 10 1809 on different hardware and we noticed some issues. Explorer keeps crashing and we decided to rollback.

  • Problem:

After the upgrade a new account logged on the computer.
DISM.exe /Online /Initiate-OSUninstall now refuses to run and says:

Error: 0xc16a0102
The OS uninstall cannot be initiated. User profiles were added.

  • Solution:

Identify the offending profile by opening the dism log file

Delete the offending profile

$UserProfiles = Get-WmiObject -Class Win32_UserProfile
# View it
$u = $UserProfiles | ? LocalPath -match 'myOffendingUserName'
$u
# Delete user folder
Get-Item "$($u.LocalPath)" | 
Remove-Item -Force -Recurse -Confirm:$false
# Delete user profile reference
$u.Delete()

Rollback to 1803 is now successful using dism.exe 😎

Decipher a message

As part of the PowerShell Summit, there’s a scripting competition also known as the “iron scripter” contest.

This year, one of the challenges was published on this page https://ironscripter.us/a-challenge-from-the-dark-faction/

There’s a message encoded with the Caesar Cipher on this page: http://bit.ly/DarkFactionMessage which leads to this text file



You can find more details on the Caesar Cipher on this wikipedia page.

About my solution: It’s clear that % is the space character. I needed to know if a character is upper or lower case and I did a substitution to the left in the ascii table by 5 or 37. Plus in some cases, I had to adjust the character without using a substitution (or I just simply failed to find the common denominator)

My quick and dirty solution is the following:

It looks like this:

The original text can be found on this page: https://devops-collective-inc.gitbook.io/the-monad-manifesto-annotated/what-is-monad