The easiest way that I’ve ever found is with a product by Magic Jellybean called Key Finder. With this you can pickup the Product Keys for Windows and Office if it’s installed and change them as required.
It’s a lot faster than using the MS Approved method and it works without a problem provided that you have a replacement Product Key from the same version.