Sometime you need to know the internal ID (Guid) of management pack or management pack element before the MP imported to SCSM. This can be done very easy using some T-SQL magic.
All queries below must be executed against main ServiceManager database
To get guid of sealed management pack:
SELECT dbo.fn_MPId('My.MP.Name', '%PUBLICKEY%')
The %PUBLICKEY% is public key of your management pack
To get guid of unsealed management pack:
SELECT dbo.fn_MPId('My.MP.Name', NULL)
To get guid of management pack element:
SELECT dbo.fn_MPObjectId('My.MP.Name', '%PUBLICKEY%', 'My.New.Class')
Here you can find good article about how to get public key from assembly (the good idea is to seal code and management pack using same strong name file).