If you don’t licence Service Manager 2012 R2 when you install it and forgot to do so before the 180 days runs out, your in trouble.
Unlike SCOM 2012 R2, there is no PowerShell command you can run to install your product key. However, all is not lost. You can log a call with Microsoft and they will provide you with SCSM Licence tool. You just run this utility on one of your management servers (as an account that has access to the DB) and it will import your key and fix your environment. The only extra step I would recommend is to reboot all the SCSM servers.