在此實驗中,我將把TimeCreated、Computer、SubjectUserName、SubjectDomainName、ObjectType、ObjectName、Opcode、ProcessName加入,要加入參數,需自行新增XML tag如下:
把它加在匯出的XML、<EventTrigger>tag中:
<ValueQueries>
<Value name="TimeCreated">Event/System/TimeCreated/@SystemTime</Value>
<Value name="Computer">Event/System/Computer</Value>
<Value name="SubjectUserName">Event/EventData/Data[@Name='SubjectUserName']</Value>
<Value name="SubjectDomainName">Event/EventData/Data[@Name='SubjectDomainName']</Value>
<Value name="ObjectType">Event/EventData/Data[@Name='ObjectType']</Value>
<Value name="ObjectName">Event/EventData/Data[@Name='ObjectName']</Value>
<Value name="Opcode">Event/System/Opcode</Value>
<Value name="ProcessName">Event/EventData/Data[@Name='ProcessName']</Value>
</ValueQueries>
第二段:
<Triggers>
<EventTrigger>
<Enabled>true</Enabled>
<Subscription><QueryList><Query Id="0" Path="Security"><Select Path="Security">*[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and EventID=4663]]</Select></Query></QueryList></Subscription>
<ValueQueries>
<Value name="TimeCreated">Event/System/TimeCreated/@SystemTime</Value>
<Value name="Computer">Event/System/@Computer</Value>
<Value name="SubjectUserName">Event/EventData/Data[@Name='SubjectUserName']</Value>
<Value name="SubjectDomainName">Event/EventData/Data[@Name='SubjectDomainName']</Value>
<Value name="ObjectType">Event/EventData/Data[@Name='ObjectType']</Value>
<Value name="ObjectName">Event/EventData/Data[@Name='ObjectName']</Value>
<Value name="Opcode">Event/System/@Opcode</Value>
<Value name="ProcessName">Event/EventData/Data[@Name='ProcessName']</Value>
</ValueQueries>
</EventTrigger>
</Triggers>
修改<Arguments>參數:
<Arguments>/c D:\SourceCode\evtout.cmd '$(TimeCreated)' '$(Computer)' '$(SubjectUserName)' '$(SubjectDomainName)' '$(ObjectType)' '$(ObjectName)' '$(Opcode)' '$(ProcessName)'</Arguments>
將該XML存檔後,在工作排程器中,刪除舊的附加工作,接著把工作匯入:
修改工作內容,如果事件在同時間會觸發多個時,可用平行或是佇列執行,在此選佇列執行:
留言