473,396 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Logon Failure

I am trying to access a remote machine's files and can't figure out how to
impersonate a user with rights to perform the task. The program runs as a
Windows Service - this is NOT ASP, IIS, Web Service, etc. related - strictly
a Windows Service. The remote machine is on a different domain so I cannot
set my service to run as that user (same would apply to Web Service). How
can I access a remote share if I know the user and password? Mapped drives
are not an option - there are about 80 remote machines that I need to talk
to.

Thanks,
Scott
Jul 21 '05 #1
1 1720
Providing you will only be using one user at a time, you can use the WNet*
api's (e.g. WNetAddConnection2) to browse and access remote servers.

Paul

"Scott Wallace" <jo**@doe.com> wrote in message
news:OP**************@TK2MSFTNGP12.phx.gbl...
I am trying to access a remote machine's files and can't figure out how to
impersonate a user with rights to perform the task. The program runs as a
Windows Service - this is NOT ASP, IIS, Web Service, etc. related - strictly a Windows Service. The remote machine is on a different domain so I cannot set my service to run as that user (same would apply to Web Service). How
can I access a remote share if I know the user and password? Mapped drives are not an option - there are about 80 remote machines that I need to talk
to.

Thanks,
Scott

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Fabrizio | last post by:
(Sorry for the crosspost, but I really don't know which is the right newsgroup!) Hi all, I try to change the password to a user that as to change the password at first logon: try {
0
by: PRM | last post by:
Hi I am sharing a network drive, by using the following code (C# Code using ASP.net /********************************************************************************** public void ShareMap(string...
0
by: Brad | last post by:
I am receiving the following error: Logon failure: unknown user name or bad password I have searched the groups for an answer but can't get my program to work. I am trying to access a networked...
3
by: rfontaine | last post by:
I have a virtual directory on IIS 5.0 to a remote share on a Windows 2003 file server. The "connect as" is a domain user account. The share as read permission for everyone and the NTFS permission...
2
by: J-T | last post by:
Hi All, We have an asp.net application on a windows 2003 server which is part of a domain controller which my worksatis is too. We have impersonated in our applciation with a fixed identity...
0
by: Marty Cruise | last post by:
I successfully deploy my application to 20 domain users. Only one new user is giving me a problem, although he can access all domain resources. When he clicks the installation link on the...
0
by: robpimentel | last post by:
Hi, I've been using DB2 for about 1 week, so please bear with me. DB2 Connect Enterprise Edition v8.1 FixPack 5 Windows Server 2003 Standard Edition SP1 Here is an error that continues to...
1
by: taufik | last post by:
Hi.. I install a web base system. I using MSSQL 2000 database and the Driver should be SQL Server. I try run the system but i couldn't open. The message that appear "Logon failure: user account...
1
by: cactuscrust | last post by:
I'm running IIS6 Windows2003, and as you'll see very quickly.. I'm pretty new to this stuff. Lately I've been getting bombarded with login attempts.... sometimes several in the same second, and it...
1
by: mcfly1204 | last post by:
We have a few systems, one running XP Pro SP3, another running Server 2000 SP4, and another running Server 2003 SP2, each has at least one service that will periodically fail to start upon a reboot. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.