Re: Impersonation for accessing network resources?




"Ben Fidge" <ben.fidge@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ebI7rJYAGHA.3780@xxxxxxxxxxxxxxxxxxxxxxx
> Hi Willy,
>
> The domain, account and password are all entered via a Form and not
> hard-coded. I've tried passing all three to LogonUser as seperate
> parameters, to no avail. I've also tried leaving domain param empty (not
> null though) and concatenating doman and account together and passing them
> in the Account param.
>
> Really starting to frustrate me now.
>
> Ben
>

I understand your frustration, but you need to make sure that
- the user account string you pass to LogonUser() has the correct syntax,
that is, it should contain the accountname "accountname" or the
"account@domainname" in UPN format
- the domain name must refer to your account domain if the user name is NOT
in UPN format, else it must be null or . for local user accounts or the
remote machine name for non local/non domain accounts.
So in your case the call could look like :

LogonUser("Administrator", "YourDomainName", "YourAdminsPwd",...);

Willy.



.



Relevant Pages

  • Re: Impersonation for accessing network resources?
    ... account and password are all entered via a Form and not ... I've tried passing all three to LogonUser as seperate ... >> as I enter when I try to access the mapped drive from explorer. ...
    (microsoft.public.dotnet.languages.csharp)
  • he should lay wildly if Henrys spread isnt deep
    ... Nowadays, valleys happen with legitimate ballets, unless they're efficient. ... To be passing or frightened will start informal memorandums to weakly commence. ... What will you account the rare integral emergencys before Hamid does? ...
    (sci.crypt)
  • Re: Southern Water...grrrr
    ... result I ended up with them passing 'my' account over to a debt ... account to a debt collectors being one of them. ... merging data earlier this year. ...
    (uk.local.kent)
  • Im not REALLY a newbie, but.......
    ... suffice to say it's just a simple bank account example type thing. ... call the swap method which looks like this: (to avoid pasting html I've had ... But I'm passing pointers, so why is it acting like I'm passing by value? ...
    (alt.comp.lang.learn.c-cpp)
  • Re: HELP with DateAdd statement and SQL
    ... making a mistake by passing the the time in UTC format. ... Using the sa account for applications is a major gaffe. ... This email account is my spam trap so I ...
    (microsoft.public.scripting.vbscript)