Files
homelab-scripts/kms.ps1
2018-11-14 21:48:30 -05:00

27 lines
1.2 KiB
PowerShell

# Windows OS
# Set KMS Host
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /skms gauntkms.home.johnhgaunt.com
# Windows Server 2016 Datacenter
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk CB7KF-BWN84-R7R2Y-793K2-8XDDG
# Windows 10 Enterprise
#c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ipk NPPR9-FWDCX-D2C8J-H872K-2YT43
# Activate it
c:\Windows\System32\cscript.exe /nologo c:\Windows\System32\slmgr.vbs /ato
# Office 2019
c:\Windows\System32\cscript.exe /nologo C:\Program Files\Microsoft Office\Office16\ospp.vbs /inpkey:NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP
# Set KMS Host
c:\Windows\System32\cscript.exe /nologo C:\Program Files\Microsoft Office\Office16\ospp.vbs /sethst:gauntkms.home.johnhgaunt.com
# Activate it
c:\Windows\System32\cscript.exe /nologo C:\Program Files\Microsoft Office\Office16\ospp.vbs /act
# https://stackoverflow.com/questions/48592120/how-do-i-find-out-from-powershell-if-i-am-on-a-server-or-workstation
$osInfo = Get-WmiObject -Class Win32_OperatingSystem
$osInfo.ProductType
# ProductType
# Data type: uint32
# Access type: Read-only
# Additional system information.
# Work Station (1)
# Domain Controller (2)
# Server (3)