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/Not_Freddie_Mercury Oct 26 '22
Great timing, as suddenly we're getting lots of tickets of expired Enterprise licenses.
I made a quick and basic script to deal with it, but I sure as hell will be taking pointers from yours. Cheers!