Home All Groups Group Topic Archive Search About

How to logon to network server via code

Author
20 Dec 2006 1:49 AM
Dean Slindee
I am writing a windows service that needs to logon to a server to import a
file residing on that server.  The server is on the local network, but in
the dmz.  Not sure is the latter makes any difference, but is there a way to
programmatically logon to that server with proper credentials with VB code?
What's involved?  Example?

Thanks in advance,
Dean S

Author
20 Dec 2006 4:01 AM
Newbie Coder
Normally you would use the LogonUser function, but knowing that it fails on
Windows 2000 Pro & Server because ACT AS PART AS THE OPERATING SYSTEM is
needed for it to succeed

However, on XP Home/Pro LogonUser is successful, but not sure on Windows
2003.

Here's a little info on using/declaring this function:

http://www.pinvoke.net/default.aspx/advapi32/LogonUser.html
http://aspalliance.com/39

That will give you a start

For more infor search MSDN for the LogonUser API in the 2003 SP1 SDK

I hope this helps,

Newbie Coder

Show quoteHide quote
"Dean Slindee" <slin***@charter.net> wrote in message
news:pH0ih.44$q32.11@newsfe04.lga...
> I am writing a windows service that needs to logon to a server to import a
> file residing on that server.  The server is on the local network, but in
> the dmz.  Not sure is the latter makes any difference, but is there a way
to
> programmatically logon to that server with proper credentials with VB
code?
> What's involved?  Example?
>
> Thanks in advance,
> Dean S
>
>