Updating KMS Server Address using PowerShell

When you deploy a new KMS server in order to replace your existing KMS server, you will need to update the « _VLMCS » DNS record. But you may want to manually force your clients to query the new KMS server. To perform this task, you can use slmgr.vbs in a PowerShell script.

First, get all the computers objects from Active Directory using the Get-ADComputer cmdlet.

Next, use slmgr.vbs with the « -skms » parameter followed by the new KMS server FQDN.

Finally, force the activation using the « -ato » parameter:

That’s all! All your clients has been updated!


Thanks for reading! You can follow me on Twitter @PrigentNico

About Nicolas 196 Articles
I work as a System Engineer, based in Switzerland with a primary focus on Microsoft technologies. I have 7 years experience in administering Windows Servers. . I am a Microsoft MVP for Cloud & Datacenter Management. I also received the PowerShell Hero 2016 award by PowerShell.0rg. And finally, I am "MCSA: Windows Server 2012" and "Administering & Deploying SCCM" certified.