📚 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:📝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.vbsInvoke-OSLicense -InstallProductKey "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"Specify the KMS server address and port:Set-KmsLicenseInfo -ServerName kms1.woshub.com -Port 1688Activate Windows on the specified KMS server:Invoke-OSLicense -ActivateOnline
27 нояб., 01:05
