Update for server 2025 and ltsc 2021/2024
This commit is contained in:
12
kms.ps1
12
kms.ps1
@@ -56,9 +56,12 @@ $osType = Get-WmiObject -Class Win32_OperatingSystem
|
|||||||
$osInfo = Get-ComputerInfo
|
$osInfo = Get-ComputerInfo
|
||||||
|
|
||||||
if ($osType.ProductType -eq 1) {
|
if ($osType.ProductType -eq 1) {
|
||||||
if ($osInfo.WindowsProductName -eq "Windows 10 Enterprise LTSC 2019") {
|
if ($osInfo.WindowsProductName -match "Windows 10 Enterprise LTSC 20[19|21|24]") {
|
||||||
# Windows 10 2019 LTSC
|
# Windows 10/11 2019/2021/2024 LTSC
|
||||||
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk M7XTQ-FN8P6-TTKYV-9D4CC-J462D
|
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk M7XTQ-FN8P6-TTKYV-9D4CC-J462D
|
||||||
|
}elseif ($osInfo.WindowsProductName -match "Windows 10 IoT Enterprise LTSB 20[19|21|24]") {
|
||||||
|
# Windows 10/11 IoT 2019/2021/2024 LTSC
|
||||||
|
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk KBN8V-HFGQ4-MGXVD-347P6-PDQGT
|
||||||
} elseif ($osInfo.WindowsProductName -eq "Windows 10 Enterprise LTSB 2016") {
|
} elseif ($osInfo.WindowsProductName -eq "Windows 10 Enterprise LTSB 2016") {
|
||||||
# Windows 10 2016 LTSB
|
# Windows 10 2016 LTSB
|
||||||
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ
|
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ
|
||||||
@@ -70,7 +73,10 @@ if ($osType.ProductType -eq 1) {
|
|||||||
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX
|
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($osInfo.WindowsProductName -eq "Windows Server 2022 DataCenter") {
|
if ($osInfo.WindowsProductName -eq "Windows Server 2025 DataCenter") {
|
||||||
|
# windows Server 2025 Datacenter
|
||||||
|
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk D764K-2NDRG-47T6Q-P8T8W-YP6DF
|
||||||
|
} elseif ($osInfo.WindowsProductName -eq "Windows Server 2022 DataCenter") {
|
||||||
# windows Server 2022 Datacenter
|
# windows Server 2022 Datacenter
|
||||||
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk WX4NM-KYWYW-QJJR4-XV3QB-6VM33
|
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk WX4NM-KYWYW-QJJR4-XV3QB-6VM33
|
||||||
} elseif ($osInfo.WindowsProductName -eq "Windows Server 2019 DataCenter") {
|
} elseif ($osInfo.WindowsProductName -eq "Windows Server 2019 DataCenter") {
|
||||||
|
|||||||
Reference in New Issue
Block a user