Send Login Info

T

Terry Olsen

I want to log to a default admin share on a server. The user running the
app doesn't have admin rights, but my program needs to grab files from say,
\\server\d$\tmp. How can I send admin credentials so that my app can get
the files it needs? I'll need to send UserName, Password, and DomainName.

Thanks!
 
J

Jelle Druyts

You can impersonate another user through unmanaged Win32 calls, take a look
at http://www.thecodeproject.com/csharp/cpimpersonation1.asp for more
information on that.

Another option (but I haven't tried that) could be to launch a WebRequest
for the file on the server. You can pass credentials with that, but I don't
know if it will work without a webserver.

Hope that helps,
 
G

Gary Milton

Why don't you just set up a new share to the 'tmp' directory on the D drive
of the server and grant read permissions on the new share to the users that
require access?

Gary
 
T

Terry Olsen

Our corporate DS guys have sharing disabled on all the servers. The only
thing that works is the default admin shares.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top