Re: How to create file on network share from ASP.NET



Hi Andre,

You can certainly impersonate a member of any domain, as long as you supply
that user's credentials. It's simply a matter of identifying the domain as
well as the user.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven

"Andre" <Andre@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FC0FADCC-A9EB-440C-9091-F21ABBC79748@xxxxxxxxxxxxxxxx
> Hi Juan,
>
> Thank you for your reply, but my point is exactly that both computers ARE
> NOT members of the same domain - one is standalone Win2003 and another is
> external domain member and I can not put both onto the same domain. Is
> there
> any other way to do it?
>
> Thank you.
>
>
>> You might also want to acquire access programmatically.
>>
>> Read this article :
>> http://www.netomatix.com/ImpersonateUser.aspx
>> and download and study the sample code provided.
>>
>>
>>
>> Juan T. Llibre
>> ASP.NET MVP
>> http://asp.net.do/foros/
>> Foros de ASP.NET en Español
>> Ven, y hablemos de ASP.NET...
>> ======================
>>
>> "Andre" <Andre@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:5052E4A2-C8DB-4C1F-B044-FFCF563A7E1E@xxxxxxxxxxxxxxxx
>> > Hi Kevin,
>> >
>> > My problem is that I don't understand how impersanation can help me. My
>> > web
>> > server (means any accounts on it) does not permissions to read/write to
>> > shared directories. Administrators of Unix and Windows domain created
>> > for me
>> > appropriate accounts for access to shares - means on Unix was created
>> > user
>> > asp with password asp which can access shared folder. From Windows
>> > Explorer
>> > on my PC I can connect to this shared folder using provided username
>> > and
>> > password. But this username and password are from remote box not the
>> > local
>> > one, which means that LogonUser will not work for me as it can be used
>> > only
>> > to login to local computer (at least that is what documentation says).
>> >
>> > Could you please help with the issue that I need to login to another
>> > box
>> > using another box'es account and not the local one?
>> >
>> > Thanks a lot.
>> > "Kevin Spencer" wrote:
>> >
>> >> Hi Andre,
>> >>
>> >> You can certainly use the System.IO classes to create files on a
>> >> network
>> >> drive in the same way that you would create them on a local machine
>> >> drive.
>> >> You can use a UNC path if you wish, or a mapped drive. The rules are
>> >> the
>> >> same. The only differences would be:
>> >>
>> >> 1. Security: Use an Active Directory domain account with the proper
>> >> permissions. Use impersonation if necessary.
>> >> 2. Unix drives: You may have some issues with the files themselves,
>> >> especially if they are text files. Carriage returns are different on
>> >> Unix
>> >> systems. The system may be using ASCII instead of Unicode text
>> >> encoding as
>> >> well.
>> >>
>> >> --
>> >> HTH,
>> >>
>> >> Kevin Spencer
>> >> Microsoft MVP
>> >> ..Net Developer
>> >> The sun never sets on
>> >> the Kingdom of Heaven
>> >>
>> >> "Andre" <Andre@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> >> news:2C9359BB-9830-4F3E-AC6C-F779FA80C551@xxxxxxxxxxxxxxxx
>> >> > Hi,
>> >> >
>> >> > I have ASP.NET application running on standalone (not part of the
>> >> > domain)
>> >> > Windows 2003. I use forms authentication for my application. The
>> >> > problem I
>> >> > have is that I need to create and read files on Windows domain
>> >> > network
>> >> > shared
>> >> > drives and also on shared via Samba Unix drives, which is equivalent
>> >> > to
>> >> > writing/reading to the workgroup computer. Please point, if
>> >> > possible, to
>> >> > detailed step by step description of what needs to be done. Thank
>> >> > you.
>> >> >
>> >> > Regards,
>> >> >
>> >>
>> >>
>> >>
>>
>>
>>


.



Relevant Pages

  • How to access to SQL with Integrated Security from ASP.Net app
    ... This account is member of the domain users and has access to the SQL ... If I impersonate a user that is member of the domain ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: sp_revoke login is not working as expected.
    ... EXEC xp_logininfo 'MyDomain\SomeUserAccount','members' ... Try specifying a group member rather than the group. ... This should list the Windows groups the user can connect with. ... connect with the non-existing login. ...
    (microsoft.public.sqlserver.security)
  • Re: Repost: Local logon and Network Access settings
    ... > think require network login since they are over the wire do in fact ... In the default situation, Authenticated Users ... > is a member of User on a member machine, and, Users are granted ... > user accounts that should be allowed to log into the machines in SomeOU. ...
    (microsoft.public.windows.group_policy)
  • Re: fmw : link between logins and cards
    ... and i have made a login/password belonging to this group, for each member ... j'ai une table dans laquelle j'ai une fiche par adherent, ... correspondant au login de cet adherent ... j'ai fait un groupe pour les adherents, j'ai fait les reglages pour les ...
    (comp.databases.filemaker)
  • Re: Multiple domains on a computer
    ... Basically I'm concerned that when he comes back and tries to login, ... a computer can only be a member of one domain at a time. ... By joining it, group policy settings and software installations may take ...
    (microsoft.public.windowsxp.security_admin)