listing unsecured shared folders on windows

后端 未结 1 1294
面向向阳花
面向向阳花 2021-01-15 23:05
//ActiveDirectorySearch1
//Displays all computer names in an Active Directory
using System;
using System.DirectoryServices;

namespace ActiveDirectorySearch1
{
    c         


        
相关标签:
1条回答
  • 2021-01-15 23:26

    If your AD is pre Windows Server 2008, you should really change your filter to (&(objectCategory=computer)(objectClass=computer)). This will take advantage of indices in the database and be much more efficient.

    As to getting Shares, I've used Win32_Share before. You can use mgmtclassgen to build a strongly typed wrapper that's pretty easy to work with.

    0 讨论(0)
提交回复
热议问题