WMI不知道,API可以。看了下顶楼的链接,只是更改审核策略。au3代码如下:#include <LocalSecurityAuthority.au3>
; 审核策略更改 - 成功|失败
; 审核特权使用 - 失败
; 审核系统事件 - 无审核
Dim $aAudit[3][2] = [[$POLICY_AUDIT_POLICY_CHANGE, _
$POLICY_AUDIT_EVENT_SUCCESS + $POLICY_AUDIT_EVENT_FAILURE], _
[$POLICY_AUDIT_PRIVILEGE_USE, $POLICY_AUDIT_EVENT_FAILURE], _
[$POLICY_AUDIT_SYSTEM, $POLICY_AUDIT_EVENT_NONE]]
If _AdjustPolicyAuditEvents($aAudit, True) Then
Msgbox(0, 'Done', 'Succeeded.')
Else
Msgbox(0, 'Failure', "Error code: " & @error)
EndIf
LocalSecurityAuthority.au3 - http://www.autoitx.com/forum.php ... &extra=page%3D1 |