Lets try again....
My apologies up front for the long discussion I hope you will find it of some interest.
I am trying to connect to 20 to 30 various NT domain servers using my program. These domain servers are NOT part of a trusted NT domain environment. Normally when I log into these domain servers I go to my work station’s Start button -> Run and then I key in: \\Server Name, I then get the authentication dialog box you see below. I can then enter for my user name "Domain\Username" and then my "password". My credentials are now cached for that server until the worked station is restarted, which allows me to connect to that server without actually having to map to it.
Is there a way to use WnetAddConnection to accomplish the same task? I would like to ask the user to enter their user credentials once save it in memory temporarily until all of my server connections have been made. Try to access the servers and do the work on it them that I need to do.
Is it considered bad practice to connect to this many servers or should I clean up after myself using WNetCancelConnection2 some how when I am done? If I need to do this, I will need hold the user’s credentials permanently in memory and then the program will pass it to Windows when it needs to make a new connection. Here lies another problem, which may have been covered in another thread; this leaves the password sitting in memory free for a hacker to see which I know can’t be good.



Reply With Quote