ADSI Help 
Author Message
 ADSI Help

When I try to run the following code to authenticate NT
Users from ASP.NET, it works fine(sometime gives me an
error). But, when I try to run from VB.NET, it always
gives me an error saying
'The credentials supplied conflict with an existing set of
credentials'

Public function AuthenticateUser(byval Domain as
string,byval User as string,byval pwd as string) as boolean
 Dim objDS,objDomain
try
 objDS = GetObject("WinNT:")
 Domain = "WinNT://" & Domain
 objDomain = objDS.OpenDSObject(Domain,User,Pwd,1)
 return true
catch Ex as Exception
 return false
end try
end function

I would appreciate any help

thanks & rgds,
renga



Sun, 04 Sep 2005 19:05:00 GMT  
 ADSI Help
I wouldn't use the GetObject, but use the DirectoryServices namespace to do
your directory tasks. Theres an example on my website, about using the
DirectoryServices namespace. In order to use it, you'll have to add a
reference to it in the Add References dialog...

http://dotnetx.betasafe.com > Languages > VB.NET > Networking > Taking a
snapshot of AD

--
Remember: There's no place like 127.0.0.1
==============================================
Happy To Help,
Tom Spink

http://dotnetx.betasafe.com >> VB, VB.NET, C#, C++ Code
Happy Coding!!

Please respond to the newsgroups, so all can benefit.

One day

Quote:
> When I try to run the following code to authenticate NT
> Users from ASP.NET, it works fine(sometime gives me an
> error). But, when I try to run from VB.NET, it always
> gives me an error saying
> 'The credentials supplied conflict with an existing set of
> credentials'

> Public function AuthenticateUser(byval Domain as
> string,byval User as string,byval pwd as string) as boolean
>  Dim objDS,objDomain
> try
>  objDS = GetObject("WinNT:")
>  Domain = "WinNT://" & Domain
>  objDomain = objDS.OpenDSObject(Domain,User,Pwd,1)
>  return true
> catch Ex as Exception
>  return false
> end try
> end function

> I would appreciate any help

> thanks & rgds,
> renga



Tue, 06 Sep 2005 03:31:44 GMT  
 ADSI Help
Tom,

I even tried using DirectoryServices namespace. The following code works
in ASP.NET, but it gives the same error in VB.NET.
Error: 'The Credentials supplied conflict with an existing set of
credentials'

Public function AuthenticateUser(Byval Domain as string,Byval UserName
as string,byval Password as string)
  Dim DirEnt as DirectoryEntry,Name as string
Try
  DirEnt = New DirectoryEntry("WinNT://" & Domain,UserName,Password)
Name = DirEnt.Name //- I get the above error in this line
return true
Catch Ex as Exception
 return false
End Try
End Function

Is this error occurs because of NT Network Version 4.0?

Thanks for your help
renga

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Tue, 06 Sep 2005 09:11:45 GMT  
 ADSI Help
Hi,

Are you trying to access active directory on NT4!? Active Directory was
introduced in Windows 2000 and later systems. Or, are you running your
program that accesses an external network, with Active Directory?

--
Remember: There's no place like 127.0.0.1
==============================================
Happy To Help,
Tom Spink

http://dotnetx.betasafe.com >> VB, VB.NET, C#, C++ Code
Happy Coding!!

Please respond to the newsgroups, so all can benefit.

One day

Quote:
> Tom,

> I even tried using DirectoryServices namespace. The following code works
> in ASP.NET, but it gives the same error in VB.NET.
> Error: 'The Credentials supplied conflict with an existing set of
> credentials'

> Public function AuthenticateUser(Byval Domain as string,Byval UserName
> as string,byval Password as string)
>   Dim DirEnt as DirectoryEntry,Name as string
> Try
>   DirEnt = New DirectoryEntry("WinNT://" & Domain,UserName,Password)
> Name = DirEnt.Name //- I get the above error in this line
> return true
> Catch Ex as Exception
>  return false
> End Try
> End Function

> Is this error occurs because of NT Network Version 4.0?

> Thanks for your help
> renga

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Tue, 06 Sep 2005 21:33:32 GMT  
 ADSI Help
Hi!
I am not accessing any external network, but we have Windows NT Network
Version 4.0

DirectoryServices object of .NET doesn't work.

Also the following code works with VB 6.0, but it doesn't with .NET

Public function AuthenticateUser(byval Domain as
string,byval User as string,byval pwd as string) as boolean
 Dim objDS,objDomain
 try
  objDS = GetObject("WinNT:")
  Domain = "WinNT://" & Domain
  objDomain = objDS.OpenDSObject(Domain,User,Pwd,1)
  return true
 catch Ex as Exception
  return false
 end try
end function

I even tried creating a dll in VB6 & using it in .NET. Still I get the
same error.

thanks & regards
Renga
DowJones Newswires

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Fri, 09 Sep 2005 10:11:18 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. ADSI Help!!!

2. ADSI Help

3. editing iis metabase with ADSI Help Needed

4. ADSI Help

5. ADSI - Help?????

6. help With ADSI

7. ADSI Programming - HELP!

8. HELP: Embedding ADSI in ASP pages

9. ADSI and VB HELP I am NEW

10. Help: Can not find ADSI v2.0 object library for VB

11. HELP: Embedding ADSI in ASP pages

12. help, adsi error trapping

 

 
Powered by phpBB® Forum Software