2016-08-17 129 views
0

我有下面的查詢 - 我希望它基於對象名只有USER1 &用戶2或RelativeTargetNameWindows事件查看器 - > XML - >自定義視圖

報告,但它基於的對象名或RelativeTargetName所有用戶報告

我該如何控制它?

<QueryList> 
    <Query Id="0" Path="Security"> 
    <Select Path="Security"> 
    *[EventData[Data[@Name='SubjectUserName'] and (Data='user1' or Data='user2')]] 
    and 
    *[EventData[Data[@Name='ObjectName'] and (Data='E:\Path\To\Folder')]] 
    or 
    *[EventData[Data[@Name='RelativeTargetName'] and (Data='Path\To\Folder')]] 
    </Select> 
    </Query> 
</QueryList> 

回答

0

這個工作

<QueryList> 
    <Query Id="0" Path="Security"> 
    <Select Path="Security"> 
    *[EventData[Data[@Name='ObjectName'] and (Data='E:\Path\To\Folder')]] and *[EventData[Data[@Name='SubjectUserName'] and (Data='user1' or Data='user2')]] 
    or 
    *[EventData[Data[@Name='RelativeTargetName'] and (Data='Path\To\Folder')]] and *[EventData[Data[@Name='SubjectUserName'] and (Data='user1' or Data='user2')]] 
    </Select> 
    </Query> 
</QueryList>