RegistrySecurity.AddAuditRule(RegistryAuditRule) 方法

定义

搜索可以将新规则与之合并的审核规则。Searches for an audit rule with which the new rule can be merged. 如果未找到符合条件的规则,则添加新规则。If none are found, adds the new rule.

public:
 void AddAuditRule(System::Security::AccessControl::RegistryAuditRule ^ rule);
public void AddAuditRule (System.Security.AccessControl.RegistryAuditRule rule);
override this.AddAuditRule : System.Security.AccessControl.RegistryAuditRule -> unit
Public Sub AddAuditRule (rule As RegistryAuditRule)

参数

rule
RegistryAuditRule

要添加的审核规则。The audit rule to add. 由此规则指定的用户来确定搜索。The user specified by this rule determines the search.

注解

AddAuditRule方法搜索与相同用户或组的规则 ruleThe AddAuditRule method searches for rules with the same user or group as rule. 如果未找到, rule 则添加。If none are found, rule is added. 如果找到匹配规则,则中的标志 rule 将合并到现有规则。If a matching rule is found, the flags in rule are merged into the existing rule.

如果规则具有不同的继承标志,则无法合并规则。Rules cannot be merged if they have different inheritance flags. 例如,如果对特定用户(没有继承标志)审核尝试写入密钥失败,并 AddAuditRule 使用来添加一个规则,该规则指定对同一用户审核失败的更改权限尝试,但对于子项 () 的继承 InheritanceFlags.ContainerInherit ,则这两个规则不能合并。For example, if failed attempts to write to a key are audited for a particular user, with no inheritance flags, and AddAuditRule is used to add a rule specifying that failed attempts to change permissions are to be audited for the same user, but with inheritance for subkeys (InheritanceFlags.ContainerInherit), the two rules cannot be merged.

适用于