Hi, @Sunil Maharjan
Thank you for posting in Microsoft Q&A forum.
I'm afraid we cannot extract SCCM product key from installed server.
For license issue, you may check this link for more details:
https://learn.microsoft.com/en-us/mem/configmgr/core/understand/learn-more-editions
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Add comment".