you need to following steps on NSH prompt:
#blcred authprofile -add -profile defaultProfile -host MASTER_APPSERVER:MASTER_APPSERVER_PORT -type SRP
#blcred cred -acquire -profile defaultProfile -username MASTER_USER -password MASTER_PASSWORD
#blcli2 -Dcom.bladelogic.cli.debug.release-only="false" -v defaultProfile Server decommissionServer Target
If you have extra servers in the environment that aren't in the portal then you either need to register them w/ the portal or you need to decomission them from the bsa env. how are you determnining that you have extra agents licensed if many of them are decomissioned ?
I checked the list of licensed servers on bladelogic liecensing portal. I manged to remove there licenses by adding them to console and then created a nsh script which will decommision them and unlicence them.
In this way I was able to remove the licenses.
Also list of licensed servers were having a huge list of servers which are no more in bladelogic environment.
So froom there I was able to figure out ~1000 servers were extra as compared to my current env.
right - when you decomission a server they are not deregistered w/ the licensing portal until 8.1 iirc. that may explain why you had extra in the portal.