Jump to content
Sign in to follow this  

WMI Help

Recommended Posts


I used the WMIExplorer (found on this site) to get some details on WMI.

I want to be able to execute a certain method.

Here's the example I got from the WMIExplorer:


$Computer = "."

$Class = "WakeUp"

$Method = "WakeColl"

$MC = [WmiClass]"\\$Computer\ROOT\N1E\WakeUp:$Class"

$InParams = $mc.psbase.GetMethodParameters($Method)

$InParams.sInArg = [string]

"Calling WakeUp. : WakeColl with Parameters :"

$inparams.PSBase.properties | select name,Value | format-Table

$R = $mc.PSBase.InvokeMethod($Method, $inParams, $Null)

"Result :"

$R | Format-list


Not sure how to translate that into something I can use in AutoIt? Below is my try, but it is not working.

$objWMIService = ObjGet("winmgmts:\\.\root\N1E\WakeUp:WakeUp")
$objinParams = $objWMIService.psbase.GetMethodParameters("WakeColl")
$objinParams.sInArg = [string]
$objOutParams = $objWMIService.ExecMethod("WakeUp", $objinParams, $SMSID)
$ReturnValue = $objOutParams.ReturnValue
MsgBox(0, "TEST", $ReturnValue)

Any ideas?



Edited by mattw112

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.