https://wmatthyssen.com/2019/09/18/hyper-v-automatic-virtual-machine-activation/
PowerShell Direct from the Hyper-V host to activated a specific AVMA key for a VM running on that host. Open a PowerShell window (as Administrator) on the Hyper-V host and run following command:
Invoke-Command -VMName "vm-tmpl-W2k19" -ScriptBlock {slmgr /ipk TNK62-RXVTB-4P47B-2D623-4GF74}