To do this we are going to utilize a small PowerShell script to remotely run a command to clear the assigned KMS host on multiple clients.
Doing this will remove the manual KMS Host entry and re-enable auto-discovery.
Normally if your clients are pointing to a dead KMS host – you will notice that you can’t activate them again in VAMT (Volume Activation Management Tool), you will receive either error : Operation Timed Out or Unable to connect to the remote server.
What the script does –
It takes a list of host names from a CSV, then runs the clear KMS cache command (slmgr.vbs /ckms) on each server listed, this will force the KMS client to auto-discover a new KMS Host on the subnet. You can change the script to manually set a different specific KMS host by using the – slmgr.vbs /skms <value>:<port> instead of slmgr.vbs /ckms.
Script / CSV Example / Script Results –
Hope this is helpful – feel free to change the slmgr.vbs command in the script if you want to utilize a different command on multiple servers/workstations.