
Using SAPGui
Execute transaction code SLICENSE. Scroll a bit down for Remote Hardware Key section. Click on Determine. A list of known host will be list out. From there, you can select which system to determine the hardware key. Highlight on the selected system and click Determine. The hardware key will be generate in the box field.

using SAP NWA
Login to the NWA and acces Configuration > Infrastructure > Licenses. Check the field “Active Hardware Key” in “System Parameters” section.

via OS Level
Login to your operating system. Execute below command.
saplicense -get
Reference
2955080 – How to check out correct hardware key of AS Java