C# Tasks for Asynchronous Operations
//creating cimsession to remote host
CimSession session = await Task.Run(() =&gt;
{
     return CimSession.Create(computerHostName);
});



Task.Run is a red flag. This should be

CimSession session = await CimSession.CreateAsync(computerHostName);


Similarly for every method you call on session which has a ...Async version, you should use the ...Async version.



It seems that you're calling this from a GUI thread. That means you need to be careful about where your continuations are executed. I would suggest pulling the async calls out into a method and using .ConfigureAwait(false) on all of them, and then calling that method from the GUI thread with ContinueWith(...) to update the GUI, but since you refuse to provide more context I can't be more specific.