having trouble configuring license mode on RDS 2012 server?

here is a good article that helps me everytime im installing RDS servers

So thank you Matt Fusaro

http://www.tbngconsulting.com/blog/bid/404182/Licensing-mode-for-the-Remote-Desktop-Session-Host-is-not-configured

update: 21-08-2018

In case you get the following

Exception calling “SetSpecifiedLicenseServerList” : “Invalid operation “

Make sure that you start powershell as administrator.

Since that didnt work either for me i found a registry key for it

HKEY_LOCAL_MACHINESOFTWAREPoliciesMicrosoftWindows NTTerminal Services

Works on Windows 2012R2 and Windows 2016 servers