Account
Windows OS Hub for SysAdmins

Windows OS Hub for SysAdmins

Windows System Admin's Blog 🌐https://woshub.com ▶️ https://www.youtube.com/@woshub ⚙️ Detailed guides cover Windows Server, Active Directory, GPO, PowerShell, Exchange, Microsoft 365, VMware, Linux and more.

Username
@woshub
Category
Technologies
Subscribers1,030
Avg views per post, 7d229−43.7% vs prev 7d
ERR22.20%last 7 days

Average views per post by day

By publication day

Show as table
DateAvg views per post
Nov 3, 2026518
Nov 4, 2026553
Nov 11, 2026411
Nov 12, 2026434
Nov 13, 2026513
Nov 18, 2026402
Nov 20, 2026410
Nov 24, 2026246
Nov 25, 2026216
Nov 27, 2026224

Most viewed this month

  1. 01
    Views553
    Forwards—
    Reactions13
    Comments—
  2. 02

    👥 In large enterprise environments, where the same infrastructure servers can be managed by multiple administrators or support teams, it sometimes happens that someone accidentally removes a specific app or agent from a management host. To investigate such incidents and identify the exact user who installed or uninstalled a specific app, you can search for the app installation and removal events in the Windows Event Viewer.   📝 Events relating to the installation or removal of classic Windows apps via the MSI installer are logged in the Event Viewer: 📥 11707 – event code for successful installation of the MSI application. 🗑 11724 – event code for uninstalling the MSI-based app   You can open the Event Viewer log console (eventvwr.msc) and enable filtering for event IDs 11707 and 11724 for the Application log, or use a simple PowerShell script to find the related events. For example, the following PowerShell script returns information about who installed or uninstalled the Zabbix agent on a Windows host and when this occurred: $app_name='*Zabbix*' Get-WinEvent -FilterHashtable @{LogName="Application"; ID=11707,11724; ProviderName='MsiInstaller'}| Where-Object { $_.Message -like $app_name }| Select TimeCreated, @{Name='Username'; Expression={(New-Object System.Security.Principal.SecurityIdentifier($_.userid)).Translate([System.Security.Principal.NTAccount]).Value}}, Message   How to Detect Which User Installed or Removed a Program on Windows using Event Viewer

    Photo
    Views518
    Forwards—
    Reactions15
    Comments—
  3. 03

    Safe Cleanup of C:\Windows\Installer Folder: Find Orphaned MSI and MSP Files 🛠 One of the common causes of running out of free space on the system drive in Windows is the C:\Windows\Installer folder. Over time, it can grow to dozens of gigabytes. This folder contains the system cache for packages installed through the Windows Installer service, including cached copies of installers in the .MSI format, as well as their update packages (.MSP format). The msiserver automatically caches installation packages to the %windir%\Installer directory when applications are installed or updated, even if the installation is subsequently cancelled. These cached copies of MSI installation files allow you to safely uninstall, repair, or modify installed Windows apps, even if the source installation files have been deleted. During a standard program uninstallation, MSI and MSP files in this folder should be removed automatically. In practice, orphaned packages often remain as a result of interrupted installations, the use of third-party uninstallers, or outdated versions being left behind after updates. ⚠️ The key point to remember is that you should never manually delete files from %windir%\Installer without thinking. You might run into issues when trying to uninstall or repair installed apps properly if you don't have cached MSI and MSP packages. ✅ We have a ready-to-use PowerShell script in our GitHub repository that queries the Windows Installer service for the list of registered packages and compares it with the files physically stored in C:\Windows\Installer. Any MSI/MSP files that exist on disk but are missing from the msiexec database are considered orphaned. The script implements the same logic as the popular third-party PatchCleaner tool. You can download this PowerShell script here. The script only lists orphaned MSI and MSP packages that are no longer associated with any installed program. It does not remove anything. Download and run the script: Set-ExecutionPolicy RemoteSigned -Scope Process .\Get-OrphanedMSIInstallers.ps1 In my case, the script found several orphaned MST patches for Adobe Acrobat Reader. These were taking up about 7 GB of space. 📚 How to Properly Clean Up the Windows Installer Folder

    Photo
    Views513
    Forwards—
    Reactions15
    Comments—
  4. 04

    How to Shrink WSL2 or Docker Desktop VHDX Files in Windows 11 🐧 When using Windows Subsystem for Linux (WSL2), the Linux distribution's virtual disk file (ext4.vhdx) can grow to tens of gigabytes. However, deleting files inside the WSL distro environment doesn’t automatically reduce the size of the VHDX file on the Windows filesystem. Dynamic VHDX files can grow as new data is written to them, but they do not automatically shrink when data is deleted inside the virtual disk from within the guest OS. ⚠️ For example, the ext4.vhdx file on the Windows system drive might occupy 50 GB, even though only 3 GB is actually being used inside WSL. These VHDX files can be manually compacted offline. 📌 To check how much space is actually being used inside WSL image: df -h / To find the path to your WSL distribution's VHDX file, first list all installed WSL distributions: wsl.exe --list –verbose Then retrieve the virtual disk information for the specified WSL image from the registry: $distro='Ubuntu-26.04' $vhdx=(Get-ChildItem -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | Where-Object { $_.GetValue("DistributionName") -eq $distro}).GetValue("BasePath") + "\ext4.vhdx" Stop the running WSL instance: wsl --shutdown Compact the VHDX file using PowerShell: Optimize-VHD -Path "..\fullpath\ext4.vhdx" -Mode Full Or using diskpart: select vdisk file="..\fullpath\ext4.vhdx" attach vdisk readonly compact vdisk detach vdisk Similarly, you can compact the Docker Desktop VHDX file after removing any unused images and containers. Optimize-VHD -Path "$env:LOCALAPPDATA\Docker\wsl\disk\docker_data.vhdx" -Mode Full 📚 In this article, we'll explore where WSL and Docker Desktop VHDX disks are stored, how to determine actual disk space usage, clean up data, and reduce the size of virtual disks using Optimize-VHD or diskpart. It also covers the experimental WSL2 sparse mode, which can automatically return unused space to the host system. How to Shrink a WSL2 or Docker Desktop Virtual Disk in Windows

    Photo
    Views434
    Forwards—
    Reactions7
    Comments—

Latest posts

#499Photo

📚 The OSLicense module is a new built-in PowerShell module designed to manage Windows activation, intended to supersede the legacy slmgr.vbs script. As we mentioned previously, Microsoft has deprecated the VBScript engine in Windows and it is expected to be removed from the OS in upcoming releases over the next couple of years.  Therefore, existing VBScript scripts will gradually be replaced by PowerShell equivalents or WMI classes. In the September updates for Windows 11, a new PowerShell module called OSLicense was added. It is designed to supersede the well-known slmgr.vbs script, which has served as the primary command-line tool for managing Windows licensing and activation for over two decades. Check whether the module is installed on the computer: Get-Module -ListAvailable -Name OSLicense Check your Windows license type and its activation status: Get-OSLicenseInfo | Select Name, Version, LicenseStatus, Description   Let's look at how to manually activate Windows against a KMS server using the OSLicense module. Install a GVLK product key for you Windows version: Invoke-OSLicense -InstallProductKey "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" Specify the KMS server address and port: Set-KmsLicenseInfo -ServerName kms1.woshub.com -Port 1688 Activate Windows on the specified KMS server: Invoke-OSLicense -ActivateOnline 📝System administrators can now proactively audit their environment for dependencies and search for scripts, MDT/SCCM task sequences, Intune/RMM automation and Group Policy scripts containing slmgr.vbs or cscript calls, and begin migrating their automation logic to the modern PowerShell cmdlets. When Microsoft disables VBScript Feature on Demand (FoD) component by default around 2027 (Phase 2 of deprecation), slmgr.vbs will stop working out of the box because it is a VBScript file. Any scripts, task sequences, or helpdesk procedures that call slmgr.vbs will fail. 📌 The post covers how OSLicense cmdlets correspond to slmgr.vbs options, along with typical usage examples, including installing and uninstalling a Windows product key, checking license status, KMS and offline activation. 📚 PowerShell OSLicense Module: Manage Windows Activation Without slmgr.vbs

Open in Telegram
Views224−43%vs avg
Forwards—
Reactions9
Comments—
#498Photo

🔥 By default, the built-in Windows Firewall doesn’t log dropped packets or successful network connections. If you suspect that the Windows Firewall is blocking connections to a specific port or IP address, you can enable firewall logging to identify the issue without disabling the firewall completely. Let’s look at how to enable logging of rejected (DROP) connections, find the connection attempts in the logs (source and port), and create the appropriate allow rule. 🧱 ☑️ The following PowerShell command configures Windows Defender Firewall to log blocked network traffic for the Public profile to a plain text file: Set-NetFireWallProfile -Profile Public -LogBlocked True -LogMaxSize 20480 -LogFileName "%systemroot%\system32\LogFiles\Firewall\pfirewall.log" -Verbose ☑️ Or you can send the network connection logs to the Windows Event Viewer. This can sometimes be more convenient than grepping plain text files. To do this, enable the following audit policy: Auditpol /set /category:"System" /SubCategory:"Filtering Platform Packet Drop" /failure:enable   Then you can use the following PowerShell function to analyze firewall log files, which presents the log as a convenient graphical table using Out-GridView.  function Get-WindowsFirewallLog { param( [parameter(Position=0,Mandatory=$false)] [ValidateScript({Test-Path $_})] [string]$LogFilePath = "$env:SystemRoot\System32\LogFiles\Firewall\pfirewall.log" ) $headerFields = @("date","time", "action","protocol","src-ip","dst-ip","src-port","dst-port","size", "tcpflags","tcpsyn", "tcpack","tcpwin","icmptype","icmpcode", "info","path") $firewallLogs = Get-Content $LogFilePath | ConvertFrom-Csv -Header $headerFields -Delimiter ' ' $firewallLogs | Out-GridView } Get-WindowsFirewallLog ✅ This guide explains how to enable Windows Firewall logging and the basic methods for searching and analyzing firewall logs. 📖 How to Enable and Analyze Windows Firewall Logs

Open in Telegram
Views216−45%vs avg
Forwards—
Reactions9
Comments—
#497Photo
Views246−37%vs avg
Forwards—
Reactions9
Comments—
#496Link preview
Views410+4%vs avg
Forwards—
Reactions11
Comments—
#495Photo
Views402+2%vs avg
Forwards—
Reactions11
Comments—
#494Photo

Safe Cleanup of C:\Windows\Installer Folder: Find Orphaned MSI and MSP Files 🛠 One of the common causes of running out of free space on the system drive in Windows is the C:\Windows\Installer folder. Over time, it can grow to dozens of gigabytes. This folder contains the system cache for packages installed through the Windows Installer service, including cached copies of installers in the .MSI format, as well as their update packages (.MSP format). The msiserver automatically caches installation packages to the %windir%\Installer directory when applications are installed or updated, even if the installation is subsequently cancelled. These cached copies of MSI installation files allow you to safely uninstall, repair, or modify installed Windows apps, even if the source installation files have been deleted. During a standard program uninstallation, MSI and MSP files in this folder should be removed automatically. In practice, orphaned packages often remain as a result of interrupted installations, the use of third-party uninstallers, or outdated versions being left behind after updates. ⚠️ The key point to remember is that you should never manually delete files from %windir%\Installer without thinking. You might run into issues when trying to uninstall or repair installed apps properly if you don't have cached MSI and MSP packages. ✅ We have a ready-to-use PowerShell script in our GitHub repository that queries the Windows Installer service for the list of registered packages and compares it with the files physically stored in C:\Windows\Installer. Any MSI/MSP files that exist on disk but are missing from the msiexec database are considered orphaned. The script implements the same logic as the popular third-party PatchCleaner tool. You can download this PowerShell script here. The script only lists orphaned MSI and MSP packages that are no longer associated with any installed program. It does not remove anything. Download and run the script: Set-ExecutionPolicy RemoteSigned -Scope Process .\Get-OrphanedMSIInstallers.ps1 In my case, the script found several orphaned MST patches for Adobe Acrobat Reader. These were taking up about 7 GB of space. 📚 How to Properly Clean Up the Windows Installer Folder

Open in Telegram
Views513+31%vs avg
Forwards—
Reactions15
Comments—
#493Photo

How to Shrink WSL2 or Docker Desktop VHDX Files in Windows 11 🐧 When using Windows Subsystem for Linux (WSL2), the Linux distribution's virtual disk file (ext4.vhdx) can grow to tens of gigabytes. However, deleting files inside the WSL distro environment doesn’t automatically reduce the size of the VHDX file on the Windows filesystem. Dynamic VHDX files can grow as new data is written to them, but they do not automatically shrink when data is deleted inside the virtual disk from within the guest OS. ⚠️ For example, the ext4.vhdx file on the Windows system drive might occupy 50 GB, even though only 3 GB is actually being used inside WSL. These VHDX files can be manually compacted offline. 📌 To check how much space is actually being used inside WSL image: df -h / To find the path to your WSL distribution's VHDX file, first list all installed WSL distributions: wsl.exe --list –verbose Then retrieve the virtual disk information for the specified WSL image from the registry: $distro='Ubuntu-26.04' $vhdx=(Get-ChildItem -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | Where-Object { $_.GetValue("DistributionName") -eq $distro}).GetValue("BasePath") + "\ext4.vhdx" Stop the running WSL instance: wsl --shutdown Compact the VHDX file using PowerShell: Optimize-VHD -Path "..\fullpath\ext4.vhdx" -Mode Full Or using diskpart: select vdisk file="..\fullpath\ext4.vhdx" attach vdisk readonly compact vdisk detach vdisk Similarly, you can compact the Docker Desktop VHDX file after removing any unused images and containers. Optimize-VHD -Path "$env:LOCALAPPDATA\Docker\wsl\disk\docker_data.vhdx" -Mode Full 📚 In this article, we'll explore where WSL and Docker Desktop VHDX disks are stored, how to determine actual disk space usage, clean up data, and reduce the size of virtual disks using Optimize-VHD or diskpart. It also covers the experimental WSL2 sparse mode, which can automatically return unused space to the host system. How to Shrink a WSL2 or Docker Desktop Virtual Disk in Windows

Open in Telegram
Views434+11%vs avg
Forwards—
Reactions7
Comments—
#492Photo
Views411+5%vs avg
Forwards—
Reactions13
Comments—
#491Photo
Views553+41%vs avg
Forwards—
Reactions13
Comments—
#490Photo

👥 In large enterprise environments, where the same infrastructure servers can be managed by multiple administrators or support teams, it sometimes happens that someone accidentally removes a specific app or agent from a management host. To investigate such incidents and identify the exact user who installed or uninstalled a specific app, you can search for the app installation and removal events in the Windows Event Viewer.   📝 Events relating to the installation or removal of classic Windows apps via the MSI installer are logged in the Event Viewer: 📥 11707 – event code for successful installation of the MSI application. 🗑 11724 – event code for uninstalling the MSI-based app   You can open the Event Viewer log console (eventvwr.msc) and enable filtering for event IDs 11707 and 11724 for the Application log, or use a simple PowerShell script to find the related events. For example, the following PowerShell script returns information about who installed or uninstalled the Zabbix agent on a Windows host and when this occurred: $app_name='*Zabbix*' Get-WinEvent -FilterHashtable @{LogName="Application"; ID=11707,11724; ProviderName='MsiInstaller'}| Where-Object { $_.Message -like $app_name }| Select TimeCreated, @{Name='Username'; Expression={(New-Object System.Security.Principal.SecurityIdentifier($_.userid)).Translate([System.Security.Principal.NTAccount]).Value}}, Message   How to Detect Which User Installed or Removed a Program on Windows using Event Viewer

Open in Telegram
Views518+32%vs avg
Forwards—
Reactions15
Comments—

All posts

Connections