Re: Impersonation for accessing network resources?
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Thu, 15 Dec 2005 17:23:24 +0100
"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.
.
- References:
- Impersonation for accessing network resources?
- From: Ben Fidge
- Re: Impersonation for accessing network resources?
- From: Willy Denoyette [MVP]
- Re: Impersonation for accessing network resources?
- From: Ben Fidge
- Re: Impersonation for accessing network resources?
- From: Willy Denoyette [MVP]
- Re: Impersonation for accessing network resources?
- From: Ben Fidge
- Impersonation for accessing network resources?
- Prev by Date: Re: A way to bitwise AND two int's
- Next by Date: Re: P/Invoke with DHCP management API
- Previous by thread: Re: Impersonation for accessing network resources?
- Next by thread: Re: Impersonation for accessing network resources?
- Index(es):
Relevant Pages
|