Warm tip: This article is reproduced from stackoverflow.com, please click
vb6 shared-directory windows2012 cyber-ark

VB6: How to connect to a network shared folder, without providing credentials using

发布于 2020-03-27 10:29:33

I want to connect to a network share path '\domainname\folder-name' using domain account, without passing credentials, through my VB6 code.

My legacy VB6 application service (running on server A) currently accesses shared folder (on server B) using local account credentials(stored in encrypted .ini file). This service is running on behalf of 'LocalSystem'. application is using 'WNetUseConnection' API to connect to shared folder.

To ensure security local account needs to be replaced by 'domain account' and password policy should be CyberArk dynamic password.

Now this credentials can't be stored in .ini file anymore. The idea that I am working on is to get service running on behalf of 'domain account' rather 'LocalSystem'. My thought is if i make service run on behalf of 'domain account, and give relevant permissions to this account on shared folder. Shared path should be accessible to service without providing credentials.

I need help to understand which API shall i use. If anyone has worked on any such solution and can help that will be great.

Thanks in advance

Questioner
Suman
Viewed
133
Hel O'Ween 2019-07-08 22:23

The API(s) you'll need for this is WNetAddConnection.

See this example.