确定谁正在访问 Windows 2008 R2 服务器/Windows 7 中共享文件夹上的文件
我需要找到一种方法来确定共享文件夹上的哪些文件正在被访问以及由谁访问。像“Net Files”和“Net Session”这样的命令以及 SysInternals 中的 PSFile.exe 可以提供此信息,但我不知道如何以编程方式执行此操作。我找到了一种方法来确定谁正在通过 WMI 访问共享,但它没有显示正在访问什么文件。有谁知道如何在 C / C++ / C# 中做到这一点?任何和所有的帮助将不胜感激。
I need to find a way to determine what files on a shared folder are being accessed, and by whom. Commands like "Net Files" and "Net Session" can give this information, as well as PSFile.exe in SysInternals, but I cannot figure out how to do this programmatically. I have found a way to determine who is accessing a share via WMI, but it does not show what file is being accessed. Does anyone know how to do this in C / C++ / C#? Any and all help will be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 ADSI(Active Directory 服务接口),前段时间我写了一篇关于这个话题的文章
使用 Delphi 和 ADSI 枚举本地和远程共享资源
示例是用 delphi 编写的,但您可以使用本文作为 ADSI 的指南。要列出打开的资源(例如文件夹和文件),您必须使用 IADsFileServiceOperations 接口和 Resources 函数返回开放资源的集合服务。
You can use ADSI (Active Directory Service Interfaces) , some time ago I wrote an article about this topic
Using Delphi and ADSI to enumerate local and remote shared resources
the samples are written in delphi but you can use this article as a guide to ADSI.To List the opened resources like folders and files you must use the IADsFileServiceOperations interface and the Resources function which return a collection of the open resources for the service.
NetFileEnum level 3 似乎就是您正在寻找的。
NetFileEnum level 3 seems to be what you're looking for.