12 lines
796 B
PowerShell

$auditPolicyRuleRef = $wsmanConnectionObject.NewReference("SELECT * FROM AMT_AuditPolicyRule WHERE PolicyRuleName='Audit Policy Rule'")
$enable = @("false", "true")
$auditedAppID = @("17", "29") # '17' = Remote Control Events. '29' = Redirection Manager Events.
$eventID = @("0", "1") # '0' = Performed Power-Up. '1' = IDE-R Session Closed
$policyType = @("0", "1")
$inputObject = $auditPolicyRuleRef.CreateMethodInput("SetAuditPolicyBulk")
$inputObject.SetProperty("Enable", $enable.SyncRoot)
$inputObject.SetProperty("AuditedAppID", $auditedAppID.SyncRoot)
$inputObject.SetProperty("EventID", $eventID.SyncRoot)
$inputObject.SetProperty("PolicyType", $policyType.SyncRoot)
$outputObject = $auditPolicyRuleRef.InvokeMethod($inputObject)
$returnValue = $outputObject.GetProperty("ReturnValue")