Getting a list of stocks connected to the machine

Note that I have connected to several resources on the remote computer (\\ machineA \ share1, \\ machineA \ share2 ....) along with a share on other remote computers.

Now my question is how to find only those domains that are associated with a specific machine. For example, only those shares that are associated with the machine.

I've met WNetOpenEnum and WNetEnumResource before. But they are very inefficient that they will return all the stocks that are connected to my machine and then I have to search for results for the stocks connected to machineA :(

I need to know if there is some other function that I can use to find the share.

I am working on VC ++ 6.0.

edit: Hi guys, I have a different problem. Whenever I try to connect to a share on the machine, I get the following error: "The associated account is currently locked and cannot be registered to" Has anyone encountered this problem and how it was resolved.

+1


source to share


3 answers


To fix the blocking issue, log in to the target server (or, if it is in a domain, log in to any domain controller in that domain), open Control Panel> Administrative Tools> Active Directory Users and Computers, navigate to the user, with which you enter and open it.



If the system is not on a domain, simply log in and unlock the account using the Local Users and Groups tool in compmgmt.msc.

+1


source


Iterating through all the stocks and choosing only the ones you want looks as effective to me as it gets. Are there any circumstances why you cannot do this? (except for laziness;))



0


source


foreach (string systemName in systemNames)
 System.IO.Directory.GetDirectories("\\"+systemName+"\");

      

0


source







All Articles