I am trying to get a two factor monitor functioning that utilizes the “NET USE” command to check the status of all the mapped drives on a server. An if/else statement determines if any drives are in the “UNAVAILABLE” or “Disconnected” state and then sets a variable to either “FAIL” or “Success” depending on the result. Nothing seems to be working with this, the code works locally just fine, but I still cannot get it to alert in SCOM. I have other two factor monitors working with the exact same server, so its not a group/agent/permission related issue.

I have also attempted to run the ‘NET USE’ via ‘cmd.exe /c “net use”‘ without any success.

Below is the code I am using within the ‘script’ tab:

Thank you all in advance for any assistance you can provide!

jaspervd answered