mirror of
https://github.com/massgravel/Microsoft-Activation-Scripts.git
synced 2026-11-11 17:19:29 +01:00
AIO add missing code
This commit is contained in:
1 parent
b86cda40b2
commit
cb5672904b
1 file changed
+16
@@ -11356,6 +11356,22 @@ if (-not $env:resetstuff) {
|
||||
Write-Host "ESU licenses for years 4-6 prevent Windows update detection. MAS will automatically remove these licenses." -ForegroundColor White -BackgroundColor Blue
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
foreach ($eyactid in $badesuactids) {
|
||||
$licenseStatus = Get-WmiInfo -tsactid $eyactid -property "LicenseStatus"
|
||||
$prodName = Get-WmiInfo -tsactid $eyactid -property "Name"
|
||||
if ($prodName) {
|
||||
$nameParts = $prodName -split ',', 2
|
||||
$prodName = if ($nameParts.Count -gt 1) { ($nameParts[1].Trim() -split '[ ,]')[0] } else { $null }
|
||||
}
|
||||
|
||||
if ($licenseStatus -eq 1) {
|
||||
$detected = $true
|
||||
$pkeyId = [LibTSforge.SPP.SLApi]::GetInstalledPkeyID($eyactid)
|
||||
[LibTSforge.SPP.SLApi]::UninstallProductKey($pkeyId)
|
||||
Write-Host "Removed license for [$prodName]." -ForegroundColor White -BackgroundColor Darkgray
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($tsactid in $tsactids) {
|
||||
|
||||
Reference in new issue
Block a user