10 lines
460 B
PowerShell

$auditLogRef = $wsmanConnectionObject.NewReference("SELECT * FROM AMT_AuditLog WHERE Name='Intel(r) AMT:Audit Log'")
$inputObject = $auditLogRef.CreateMethodInput("SetAuditLock")
$inputObject.SetProperty("LockTimeoutInSeconds", "180")
$inputObject.SetProperty("Flag", "0")
$outpObject = $auditLogRef.InvokeMethod($inputObject)
$returnValue = $outpObject.GetProperty("ReturnValue")
if($returnValue -like "0")
{
$handle = $outpObject.GetProperty("Handle")
}