Using .Net how can I check which users in our domain have resources (files, shares) open on a remote Windows server?
If you have any C# examples I’d be grateful.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think you can do that using the WMI class
Win32_ConnectionShare. This discussion has an answer with a simple C# sample that should get you started.Edit: Just realised that the NetFileEnum API might be a better solution. If you look at the PInvoke page for it here, you can find a basic C# sample.