Latest Posts

HP Audio Fix

Recently I came across an issue were multiple HP systems that had a fresh install of Windows 10 Pro 1703 from a known working ISO and then upgraded to 1709. Once on 1709 the audio drivers wouldn’t work at all and if you tried to install the correct driver from HP it still wouldn’t fix it. Even manually specifying the correct driver wouldn’t fix it. It’s possible that this issue isn’t solely linked to HPs, however they are the only ones I’ve seen with this issue so far.

I’ve noticed this issue on the following HP systems:

  • HP EliteDesk 800 G1 SFF
  • HP ProDesk 400 G4 SFF
  • HP 280 G2 SFF

Device manager will either show one or two drivers under system devices as having issues and no devices will show up in playback devices.

The issue seems to be that the Windows thinks the High Definition Audio Controller is the correct driver when it’s not. Uninstalling the devices from device manager doesn’t work either. I think it’s because the registry basically has the drivers hardcoded. What I think is happening is that Windows sees the audio device’s hardware id and then matches it against the registry and the registry points it back to the same problematic driver .inf file, so you end up in an endless loop of always installing the same driver.

The fix is amazingly simple, you just need to delete the HDAudBus key from the registry which is located at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HDAudBus

If you’re not comfortable deleting things out the registry I highly recommend that you backup the key before deleting it and even creating a system restore point. As you can really mess up Windows if you delete the wrong thing. I am not responsible for any damages you cause to your system.

Once you delete that key and reboot, Windows should just pick up the correct driver automatically. In the event that it doesn’t just download the drivers from HP. You’ll need the Intel HD Graphics driver as one of the audio drivers is for audio over HMDI or DisplayPort. The second driver you will need is the Realtek Audio driver which manages the audio for the headphone jacks.

If you make a .reg file with the code below you can just run the .reg file and it will delete the registry key for you.

Windows Registry Editor Version 5.00


After you’ve applied the fix device manager should now have two devices under Sounds, video and game controllers, the High Definition Audio Controller will no longer display an error, and you’ll see one or two devices in your

If you’re curious about the registry key you are deleting here’s an export of the problematic HDAudBus registry key. (the contents of the key will vary per system but at the core it’s still the same)

"Group"="Extended Base"
"DisplayName"="@hdaudbus.inf,%HDAudBus.SVCDESC%;Microsoft UAA Bus Driver for High Definition Audio"




Mass Edit ADSI Values

I got tired of having to manually edit ADSI values for more then one user so I wrote a PowerShell script to automate the process. I even went to the extent to include a display of the values that were changed at the end. The main purpose of this script was to edit the msExchHideFromAddressLists value when the user is placed in a specific OU. I ended up deciding to make my script in a way so that I could just change 3 values and it will do all the work.

Here’s the script.

$value = "msExchHideFromAddressLists"
$ou = "OU=Disabled Users,OU=Contoso,DC=contoso,DC=local"
$yesno = $true

$search = Get-ADUser -filter * -searchbase $ou

Foreach ($U in $search) {
Set-ADUser $U -replace @{$value=$yesno}

Write-Output "Results"

Get-ADUser -filter {($value -eq $yesno)} -searchbase $ou -properties $value | Select-Object UserPrincipalName, $value

Just alter $value, $ou, and $yesno to suit your needs and the script does the rest.

Swap Office 365 Licences

I needed to remove some expired Office 365 licences that were expired to the point where I couldn’t do it via the admin interface so I wrote a PowerShell script to automate swapping the Office 365 licences.

You will want to run Get-MsolAccountSku this will list out the various SKUs your account has. something like this


Just change the values in the script below to match what product you want to remove and replace it with and then run it.

$remove = "tenant:EXCHANGESTANDARD"
$add = "tenant:O365_BUSINESS_PREMIUM"

$swap = get-MSOLUser -All | where {$_.isLicensed -eq "TRUE" -and $_.Licenses.AccountSKUID -eq "$remove"}

Foreach ($User in $swap) {
Set-MsolUserLicense -UserPrincipalName $User.UserPrincipalName -RemoveLicenses "$remove" -AddLicenses $add

That is basically it. It will just run and swap the licences.

Find files and folders

Recently I needed to find all files and folders containing two spaces, normally I would use something like a file renamer but in this case for various reasons I just needed to generate a list. Eventually I ended up figuring out a PowerShell command to do it.

Here’s the code I used to do it

get-childitem -recurse | where-object {$_ -match ' '} | select-object FullName | export-csv -notypeinformation -delimiter '|' C:\file.csv

The same code can be used to find anything. Just replace the two spaces with whatever you need to find.

copy files and create directories

I needed to come up with a solution to copy a directory/file to a specific location but I also needed to account for the fact that it might not be created so I needed it to also create the necessary folder structure and if the file existed I needed it to overwrite it.

This is the batch script I came up with

if not exist %appdata%\PROGRAM\settings mkdir %appdata%\PROGRAM\settings
copy "\\SERVER\SHARED\source" %appdata%\PROGRAM\settings /y

Basically what the script is doing is checking C:\Users\USERNAME\AppData\Roaming\PROGRAM\settings to see if it exists if it doesn’t then it will create it. Next the script is copying the contents from the UNC path into the folder.

The way the script is currently written anything in the folder named source will get dumped into the settings folder in Roaming. If you need to copy just a specific file just add the specific file in the copy command and run it. For this solution I just set the script to be a Logon script via a GPO.