Hi @StewartBW ,
When you stop and restart the WMI service, it might take some time for it to initialize fully and start providing accurate information again. During this initialization period, your code may not be able to retrieve the expected data.
You can try using loops with a delay to retry until the query returns a result.
Best Regards.
Jiachen Li
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.