【问题标题】:User group changed event用户组更改事件
【发布时间】:2013-10-18 12:10:44
【问题描述】:

有什么方法可以知道用户组成员列表何时发生变化?我尝试使用WMI 查询,例如:

SELECT * 
FROM __InstanceModificationEvent WITHIN 5 
WHERE TargetInstance ISA 'Win32_Group'

但它不起作用(事件永远不会触发)。当用户组成员更改时,可能会触发 Win32 事件?

更新 1

__InstanceOperationEvent 也不起作用。我需要在应用组策略并从本地计算机上的用户组中添加/删除用户时获取事件以显示此更改。

【问题讨论】:

    标签: c# .net winapi wmi


    【解决方案1】:

    似乎__InstanceModificationEvent事件在这个类中没有触发,但是你可以使用这些其他事件。

    要检测更改,请使用__InstanceOperationEvent 事件,

    Select * From __InstanceOperationEvent Within 1 Where TargetInstance ISA 'Win32_Group'
    

    要检测组的创建,请使用__InstanceCreationEvent 事件,

    Select * From __InstanceCreationEvent Within 1 Where TargetInstance ISA 'Win32_Group'
    

    要检测组的删除,请使用__InstanceDeletionEvent 事件

    Select * From __InstanceDeletionEvent Within 1 Where TargetInstance ISA 'Win32_Group'
    

    【讨论】:

      【解决方案2】:

      试试这个:

      SELECT * FROM __InstanceOperationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_Group';
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-06-29
        • 1970-01-01
        • 2013-09-30
        • 2019-05-10
        • 2011-04-18
        • 2016-02-23
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多