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).
RT @scsmru: New blog post: How to get Guid of management pack element even before import MP to #SCSM http://t.co/x46puloIMN
[…] postAll credits and knowledge for this post goes completely to Anton Gritsenko for his great post here and to Mihai Sarbulescu for his excellent post here.I have just summed the topic up in a way that I […]