ADSI problems using SetPassword with DirectoryEntry.Invoke

ADSI problems using SetPassword with DirectoryEntry.Invoke

Post by Stan Vele » Sat, 19 Oct 2002 02:29:31



hi,
i am trying to set the password of an existing AD user through .Net
DirectoryEntry using the Invoke() method.
my code is as follows:

Dim new_de As DirectoryEntry = New
DirectoryEntry("LDAP://adserver/CN=username,OU=Testing,DC=domain,DC=local",
_


                                                            "adminpass",
AuthenticationTypes.XYZ)

Dim password As Object() = {"password"}
new_de.Invoke("SetPassword", password)
new_de.CommitChanges()
new_de.Close()

in changing the AuthenticationTypes parameter on the DirectoryEntry
constructor i get either
"Network path not found" or
"The handle specified is invalid"
error messages from the System.RuntimeType.InvokeDispMethod(...)

the machine running the .Net application and the AD server belong to the
same domain, and the client accesses the AD server over the network.
i do not have SSL certificate installed on either machine.

could someone point out what is the obvios mistake i am making here, or the
right way to do this.
thank you,
stan velev

 
 
 

ADSI problems using SetPassword with DirectoryEntry.Invoke

Post by MS » Sat, 19 Oct 2002 08:40:40


Are you using AuthenticationTypes.Secure ?

Can you tell me if you get an exception when you do
   Console.WriteLine( new_de.Path)

after the constructor, but before .Invoke(..)

--
This posting is provided "AS IS" with no warranties, and confers no rights.


Quote:> hi,
> i am trying to set the password of an existing AD user through .Net
> DirectoryEntry using the Invoke() method.
> my code is as follows:

> Dim new_de As DirectoryEntry = New

DirectoryEntry("LDAP://adserver/CN=username,OU=Testing,DC=domain,DC=local",
> _


>                                                             "adminpass",
> AuthenticationTypes.XYZ)

> Dim password As Object() = {"password"}
> new_de.Invoke("SetPassword", password)
> new_de.CommitChanges()
> new_de.Close()

> in changing the AuthenticationTypes parameter on the DirectoryEntry
> constructor i get either
> "Network path not found" or
> "The handle specified is invalid"
> error messages from the System.RuntimeType.InvokeDispMethod(...)

> the machine running the .Net application and the AD server belong to the
> same domain, and the client accesses the AD server over the network.
> i do not have SSL certificate installed on either machine.

> could someone point out what is the obvios mistake i am making here, or
the
> right way to do this.
> thank you,
> stan velev


 
 
 

ADSI problems using SetPassword with DirectoryEntry.Invoke

Post by Pablo Armengo » Sun, 20 Oct 2002 00:19:01


I have the same problem... i'm using AuthenticationTypes.Secure and the path
of the DirectoryEntry instance is the correct... in my case i'm adding a new
user, committing the changes (settings the properties) and then invoke
SetPassword...

My path before add the user is

"LDAP://server1/OU=Business,OU=iBanking,DC=DOMAIN,DC=INVERTIA,DC=COM"

and after add successfully the user "rsmith"

"LDAP://server1/cn=rsmith,OU=Business,OU=iBanking,DC=DOMAIN,DC=INVERTIA,DC=C
OM"

then, in the invoke sentence, i get the same exception that Stan, "The
network path was not found"...

regards,

Pablo



> Are you using AuthenticationTypes.Secure ?

> Can you tell me if you get an exception when you do
>    Console.WriteLine( new_de.Path)

> after the constructor, but before .Invoke(..)

> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.



> > hi,
> > i am trying to set the password of an existing AD user through .Net
> > DirectoryEntry using the Invoke() method.
> > my code is as follows:

> > Dim new_de As DirectoryEntry = New

DirectoryEntry("LDAP://adserver/CN=username,OU=Testing,DC=domain,DC=local",

- Show quoted text -

> > _


> >                                                             "adminpass",
> > AuthenticationTypes.XYZ)

> > Dim password As Object() = {"password"}
> > new_de.Invoke("SetPassword", password)
> > new_de.CommitChanges()
> > new_de.Close()

> > in changing the AuthenticationTypes parameter on the DirectoryEntry
> > constructor i get either
> > "Network path not found" or
> > "The handle specified is invalid"
> > error messages from the System.RuntimeType.InvokeDispMethod(...)

> > the machine running the .Net application and the AD server belong to the
> > same domain, and the client accesses the AD server over the network.
> > i do not have SSL certificate installed on either machine.

> > could someone point out what is the obvios mistake i am making here, or
> the
> > right way to do this.
> > thank you,
> > stan velev

 
 
 

ADSI problems using SetPassword with DirectoryEntry.Invoke

Post by Stan Vele » Sun, 20 Oct 2002 00:45:32


thank you for your response !
If i put the line you suggest, i do not get an exception on that line. i am
binding correctly to the user object.
but i still get a "Network path not found" exception on the .Invoke()
method.
In this particular case i was using AuthenticationType.Secure, but i have
noticed that depending on the AuthenticationType the error message changes
between "Network path not found" and "(0x8007052e): The handle specified is
invalid".
If  I use "secure", the message is the "path not found", otherwise the
message is about the handle being invalid.

thanks,
stan



> Are you using AuthenticationTypes.Secure ?

> Can you tell me if you get an exception when you do
>    Console.WriteLine( new_de.Path)

> after the constructor, but before .Invoke(..)

> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.



> > hi,
> > i am trying to set the password of an existing AD user through .Net
> > DirectoryEntry using the Invoke() method.
> > my code is as follows:

> > Dim new_de As DirectoryEntry = New

DirectoryEntry("LDAP://adserver/CN=username,OU=Testing,DC=domain,DC=local",

- Show quoted text -

> > _


> >                                                             "adminpass",
> > AuthenticationTypes.XYZ)

> > Dim password As Object() = {"password"}
> > new_de.Invoke("SetPassword", password)
> > new_de.CommitChanges()
> > new_de.Close()

> > in changing the AuthenticationTypes parameter on the DirectoryEntry
> > constructor i get either
> > "Network path not found" or
> > "The handle specified is invalid"
> > error messages from the System.RuntimeType.InvokeDispMethod(...)

> > the machine running the .Net application and the AD server belong to the
> > same domain, and the client accesses the AD server over the network.
> > i do not have SSL certificate installed on either machine.

> > could someone point out what is the obvios mistake i am making here, or
> the
> > right way to do this.
> > thank you,
> > stan velev

 
 
 

ADSI problems using SetPassword with DirectoryEntry.Invoke

Post by Stan Vele » Sun, 20 Oct 2002 06:22:56


The more i try to figure this out, the more i think its a problem with some
other service, and not ADSI or .Net in particular.
I believe the code is fine, but we have a problem with the AD setup, or
another Windows 2000 service.
I have another application which uses ADSI and it has the same problem
"Network path not found" as I try to set a user password.
thats why i think the problem is somewhere else.
Maybe Kerberos or some aspect of DNS, who knows. I would look into these
next.
I am still looking for a solution to this problem.

thanks,
stan


Quote:> I have the same problem... i'm using AuthenticationTypes.Secure and the
path
> of the DirectoryEntry instance is the correct... in my case i'm adding a
new
> user, committing the changes (settings the properties) and then invoke
> SetPassword...

> My path before add the user is

> "LDAP://server1/OU=Business,OU=iBanking,DC=DOMAIN,DC=INVERTIA,DC=COM"

> and after add successfully the user "rsmith"

"LDAP://server1/cn=rsmith,OU=Business,OU=iBanking,DC=DOMAIN,DC=INVERTIA,DC=C
> OM"

> then, in the invoke sentence, i get the same exception that Stan, "The
> network path was not found"...

> regards,

> Pablo



> > Are you using AuthenticationTypes.Secure ?

> > Can you tell me if you get an exception when you do
> >    Console.WriteLine( new_de.Path)

> > after the constructor, but before .Invoke(..)

> > --
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.



> > > hi,
> > > i am trying to set the password of an existing AD user through .Net
> > > DirectoryEntry using the Invoke() method.
> > > my code is as follows:

> > > Dim new_de As DirectoryEntry = New

DirectoryEntry("LDAP://adserver/CN=username,OU=Testing,DC=domain,DC=local",

- Show quoted text -

> > > _


"adminpass",
> > > AuthenticationTypes.XYZ)

> > > Dim password As Object() = {"password"}
> > > new_de.Invoke("SetPassword", password)
> > > new_de.CommitChanges()
> > > new_de.Close()

> > > in changing the AuthenticationTypes parameter on the DirectoryEntry
> > > constructor i get either
> > > "Network path not found" or
> > > "The handle specified is invalid"
> > > error messages from the System.RuntimeType.InvokeDispMethod(...)

> > > the machine running the .Net application and the AD server belong to
the
> > > same domain, and the client accesses the AD server over the network.
> > > i do not have SSL certificate installed on either machine.

> > > could someone point out what is the obvios mistake i am making here,
or
> > the
> > > right way to do this.
> > > thank you,
> > > stan velev

 
 
 

ADSI problems using SetPassword with DirectoryEntry.Invoke

Post by Pablo Armengo » Wed, 23 Oct 2002 03:59:04


Stan, the past friday, i try to manage the client computer, where the code
is complied, from de domain controller server, and i couldn't, and the
message was "The network path was not found". May be you are right in
considerer a DNS problem... or a domain problem. My domain controller server
is W2K and my client computer XP Pro, the computer appear in the domain but
i can't log on to the domain from that computer, because it keep busy and
never return control... i have to restart it.
regards,

Pablo


> The more i try to figure this out, the more i think its a problem with
some
> other service, and not ADSI or .Net in particular.
> I believe the code is fine, but we have a problem with the AD setup, or
> another Windows 2000 service.
> I have another application which uses ADSI and it has the same problem
> "Network path not found" as I try to set a user password.
> thats why i think the problem is somewhere else.
> Maybe Kerberos or some aspect of DNS, who knows. I would look into these
> next.
> I am still looking for a solution to this problem.

> thanks,
> stan



> > I have the same problem... i'm using AuthenticationTypes.Secure and the
> path
> > of the DirectoryEntry instance is the correct... in my case i'm adding a
> new
> > user, committing the changes (settings the properties) and then invoke
> > SetPassword...

> > My path before add the user is

> > "LDAP://server1/OU=Business,OU=iBanking,DC=DOMAIN,DC=INVERTIA,DC=COM"

> > and after add successfully the user "rsmith"

"LDAP://server1/cn=rsmith,OU=Business,OU=iBanking,DC=DOMAIN,DC=INVERTIA,DC=C

- Show quoted text -

> > OM"

> > then, in the invoke sentence, i get the same exception that Stan, "The
> > network path was not found"...

> > regards,

> > Pablo



> > > Are you using AuthenticationTypes.Secure ?

> > > Can you tell me if you get an exception when you do
> > >    Console.WriteLine( new_de.Path)

> > > after the constructor, but before .Invoke(..)

> > > --
> > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.



> > > > hi,
> > > > i am trying to set the password of an existing AD user through .Net
> > > > DirectoryEntry using the Invoke() method.
> > > > my code is as follows:

> > > > Dim new_de As DirectoryEntry = New

DirectoryEntry("LDAP://adserver/CN=username,OU=Testing,DC=domain,DC=local",

- Show quoted text -

> > > > _


> "adminpass",
> > > > AuthenticationTypes.XYZ)

> > > > Dim password As Object() = {"password"}
> > > > new_de.Invoke("SetPassword", password)
> > > > new_de.CommitChanges()
> > > > new_de.Close()

> > > > in changing the AuthenticationTypes parameter on the DirectoryEntry
> > > > constructor i get either
> > > > "Network path not found" or
> > > > "The handle specified is invalid"
> > > > error messages from the System.RuntimeType.InvokeDispMethod(...)

> > > > the machine running the .Net application and the AD server belong to
> the
> > > > same domain, and the client accesses the AD server over the network.
> > > > i do not have SSL certificate installed on either machine.

> > > > could someone point out what is the obvios mistake i am making here,
> or
> > > the
> > > > right way to do this.
> > > > thank you,
> > > > stan velev