added desktop enterprise/pro/ltsc/ltsb versions
This commit is contained in:
28
kms.ps1
28
kms.ps1
@@ -56,15 +56,23 @@ $osType = Get-WmiObject -Class Win32_OperatingSystem
|
||||
$osInfo = Get-ComputerInfo
|
||||
|
||||
if ($osType.ProductType -gt 1) {
|
||||
|
||||
# Windows 10 Enterprise
|
||||
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk NPPR9-FWDCX-D2C8J-H872K-2YT43
|
||||
# Windows 10 2016 LTSB
|
||||
#c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ
|
||||
# Windows 10 2019 LTSC
|
||||
#c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk M7XTQ-FN8P6-TTKYV-9D4CC-J462D
|
||||
|
||||
|
||||
if ($osInfo.WindowsProductName -match "Windows 1[0-1] Enterprise") {
|
||||
# Windows 10/11 Enterprise
|
||||
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk NPPR9-FWDCX-D2C8J-H872K-2YT43
|
||||
} elseif ($osInfo.WindowsProductName -eq "Windows 1[0-1] Professional") {
|
||||
# Windows 10/11 Pro
|
||||
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX
|
||||
} elseif ($osInfo.WindowsProductName -eq "Windows 10 Enterprise LTSC 2019") {
|
||||
# Windows 10 2019 LTSC
|
||||
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk M7XTQ-FN8P6-TTKYV-9D4CC-J462D
|
||||
} elseif ($osInfo.WindowsProductName -eq "Windows 10 Enterprise LTSB 2016")
|
||||
# Windows 10 2016 LTSB
|
||||
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ
|
||||
} else {
|
||||
$message = "Your desktop version is not supported or could not be detected corrected. Version: $($osInfo.WindowsProductName)"
|
||||
write-error $message
|
||||
exit
|
||||
}
|
||||
} else {
|
||||
if ($osInfo.WindowsProductName -eq "Windows Server 2022 DataCenter") {
|
||||
# windows Server 2022 Datacenter
|
||||
@@ -86,6 +94,8 @@ if ($osType.ProductType -gt 1) {
|
||||
# Activate it
|
||||
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ato
|
||||
|
||||
# lets check for an office install
|
||||
|
||||
if (test-path "C:\Program Files\Microsoft Office\Office16\ospp.vbs") {
|
||||
# Office 2019
|
||||
c:\Windows\System32\cscript.exe /nologo "C:\Program Files\Microsoft Office\Office16\ospp.vbs" /inpkey:NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP
|
||||
|
||||
Reference in New Issue
Block a user