r/usefulscripts • u/feldrim • Oct 26 '22
[PowerShell] Using PowerShell for KMS activation, instead of slmgr.vbs
It's a drop-in replacement for slmgr.vbs script. Today I stumbled upon the script I created and shared here 2 years ago. I checked that and made some improvements.
The differences from slmgr.vbs:
You can provide an array of computer names, and it is up to you how you get them. It's just PowerShell.
It works on PowerShell version 5.0 and above. It means PowerShell 7.0 is ok, too.
It uses WinRM for remote computers. Check if remote computers are accessible over WinRM.
It includes a list of KMS keys, so that you don't have to for most of them. It covers some of the versions, not all of them.
It works even if you disabled
cscriptandwscript.The code is documented and readable, so that you can improve according to your needs.
Gist:
It's a drop-in replacement for slmgr.vbs script (github.com)
1
u/Zulgrib Feb 26 '23
Maybe an error reading the script, but the ability to set the kms server ip+port is missing while slmgr.vbs allowed that.
I know you can specify the server with the _vlmcs subdomain, but dns issues happen.
Thank you for sharing.