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)
2
u/branhama Oct 26 '22
I can see this as being useful, thanks for the post.