Category Archives: Software / Applications

BOIS Windows Serial Number

With the update to Windows 11 24H2, wmic is going away.
In many versions of Windows it has been possible to get the Windows serial number saved in the BIOS using the command:
wmic bios get serialnumber
This can also be done with PowerShell:
get-ciminstance win32_bios | select SerialNumber
So you can still get the bios key out of the bios from the command line.

Fix for CrowdStrike Windows Crashes

Earlier today CrowdStrike release an update that can cause Windows based computer to crash to a bluescreen of death. An update to their product has been provided to stop this from impacting further computers.

If a computer is crashing to a BSOD the following can be done to get the computer to work normally.

1. Boot Windows into Safe Mode or the Windows Recovery Environment
2. Navigate to the C:\Windows\System32\drivers\CrowdStrike directory
3. Locate the file matching “C-00000291*.sys” and delete it. 
4. Boot the host normally.

Hopefully this helps my fellow techs.

CIDR Conversation Table

CIDR Conversion Table

CIDR LengthMask# of Networks#  of Hosts
/1128.0.0.0128 A2,147,483,392
/2192.0.0.064 A1,073,741,696
/3224.0.0.032 A536,870,848
/4240.0.0.016 A268,435,424
/5248.0.0.08 A134,217,712
/6252.0.0.04 A67,108,856
/7254.0.0.02 A33,554,428
/8255.0.0.01 A16,777,214
/9255.128.0.0128 B8,388,352
/10255.192.0.064 B4,194,176
/11255.224.0.032 B2,097,088
/12255.240.0.016 B1,048,544
/13255.248.0.08 B524,272
/14255.252.0.04 B262,136
/15255.254.0.02 B131,068
/16255.255.0.01 B65,024
/17255.255.128.0128 C32,512
/18255.255.192.064 C16,256
/19255.255.224.032 C8,128
/20255.255.240.016 C4,064
/21255.255.248.08 C2,032
/22255.255.252.04 C1,016
/23255.255.254.02 C508
/24255.255.255.01 C254
/25255.255.255.1282 subnets124
/26255.255.255.1924 subnets62
/27255.255.255.2248 subnets30
/28255.255.255.24016 subnets14
/29255.255.255.24832 subnets6
/30255.255.255.25264 subnets2
/31255.255.255.254nonenone
/32255.255.255.255none1

Windows Update error 0x80092004 Windows 7 & 2008

Microsoft changed the signing of update packages for Windows 7 and Windows Server 2008 R2 devices on the August 2019 Patch Day for the first time. The company signs packages only with SHA-2 since August 2019; it signed them with SHA-1 and SHA-2 previously but decided to drop SHA-1 because of known weaknesses.

Two updates need to be installed on Windows 7 and Windows Server 2008 R2 systems so that SHA-2 signed updates are installed correctly:

  • KB4474419 — SHA-2 code signing support update for Windows Server 2008 R2, Windows 7, and Windows Server 2008: August 13, 2019
  • KB4490628 — Servicing stack update for Windows 7 SP1 and Windows Server 2008 R2 SP1: March 12, 2019

Export List of Office 365 Licenses by Type

It’s possible to to use Powershell to export lists of users who are allocated different licences in Office 365. This guide will help you export a csv file that contains a list of the users who have a specific license type.

Part 1 – Connecting to Office 365 with Powershell

  1. First open a powershell console enter the following:
    $UserCredential = Get-Credential
  2. You will be prompted for your Office 365 username and password
  3. Now we must establish a conenction using the stored credentials:
    Connect-MsolService -Credential $UserCredential
  4. Now that you are connected to Office 365’s powershell interface you can now issue commands to Office 365.

Part 2 – Listing Licences in your account

Enter the command:

Get-MsolAccountSku

This will display a list of licences and the number of each you own and are utilised.

AccountSkuiD: <instancename>:<licencename>
ActiveUnits: The number of licences available based on your subscription
WarningUnits: Licenses in warning state
ComsumedUnits: Licenses in use and assigned to users.

Part 3 – Exporting the Data for a specific Licenes Type

Enter the following command, this will export a list of users with Power BI Standard license assigned to them. Remember to change <instancename> to match the instance name displayed in your output from part 2.

get-MSOLUser -All | where {$_.isLicensed -eq "TRUE" -and $_.Licenses.AccountSKUID -eq "<instancename>:POWER_BI_STANDARD"} | select displayname,userprincipalname,isLicensed | export-CSV c:\crmstandardusers.csv

You will now have a CSV file containing a list of the users with the specified license. You can perform this with any licenses listed from the Get-MsolAccountSku command.

Enable Strict Transport Security on IIS

The following is a guide to enable Strict Transport Security on IIS (Internet Information Server).

Open up IIS Manager and navigate to the the Server Name

Select HTTP Responce

Click on Add, and enter the values as follows

Click ok and then click on the server name again, select the restart option from the actions pane.

You server should now pass Qualys SSL Test for Strict Transport Security.

Provision Windows Store Apps for Windows 10 Imaging

When building fat Windows 10 Images it is necessary to sometimes install Windows Store apps, however you can’t just install them from the standard Windows Store, doing so will cause sysprep to fail. At no point should you try to run any Windows store apps when building an image.

DISM can be used to provision the app for all users in your image. The following is an example command using Microsoft Reader, it’s dependance of Microsoft VCLibs and finally it’s licence file:

Dism /Online /Add-ProvisionedAppxPackage /PackagePath:Microsoft.Reader_2017.612.315.3642_neutral_~_8wekyb3d8bbwe.AppxBundle /DependencyPackagePath:Microsoft.VCLibs.120.00_12.0.21005.1_x64__8wekyb3d8bbwe.Appx /LicensePath:Microsoft.Reader_8wekyb3d8bbwe_e5086f30-ff13-cf16-91fb-0cc6ed9c5613.xml

To obtain the app files you must download them from the Microsoft Windows Store for Business. Sign in with a user account and find the package you are looking for.

Once you have found the app you’re looking for select offline for the licence type.

Click Manager, then no the next screen click Get App.

Now Select your Processor architecture, if 32 bit windows select x86, for 64 bit select X64, Finally select your language. Ignore the Download button at the end of the line this will download a JSON file not required for this process.

Scroll down and click the Download link under “Download the package for offline use”, this will download the Package for Reader.

The next link down the page is the licensing file for Offline install, download this preferably to the same location.

Finally after the licence link you will see “Required frameworks”, this of course depends on the app you are trying to download, these may be architecture dependent also. Download these files into the same location as well.

Once you have all the files in a single folder or location open a command prompt or powershell window with administrator privileges and change directory to the location of your downloaded files from the Windows Store.

Execute the DSIM command like the following:

Dism /Online /Add-ProvisionedAppxPackage /PackagePath:PackageFileName /DependencyPackagePath:DependencyPackageFileName /LicensePath:LicenceFilename

Once this as executed the package will install for all users, and your windows image will seal correctly.

TechNet – DISM App Package (.appx or .appxbundle) Servicing Command-Line Options