Variable WMI not found…

When you are setting up alerts using WMI and if your intention is to capture the event data with sql agent job make sure you change below settings in SQL Server Agent Configuration.



EXEC msdb.dbo.sp_set_sqlagent_properties @alert_replace_runtime_tokens = 1


This will allow SQL Server Agent to replace the tokens with running values (what database changed, who changed it etc.). Read more about using Tokens in Job Steps here (make sure you read the security note in the article and understand the security risk).


One thought on “Variable WMI not found…

  1. Andrew says:

    This has answered a problem I’ve spent around a day troubleshooting. I’ve seen “Unable to start execution of step 1 (reason: Error retriving WMI variable WMI(TextData): 0x80041002). The step failed.” too many times. Thanks!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s