Solved

ADSI Problem

Posted on 2002-06-13
9
1,977 Views
Last Modified: 2007-12-19
Hello friends,
I'm having a problem using ADSI to change a password for a user in Active Directory from an ASP page. All users of the website must log in to the website (we use NT authentication, therefore there is an entry in Active Directory for each user). The web farm including the domain controller is behind a firewall and is separate from the domain that the users reside in. Also, I don't know if it makes a difference or not but the users are using NT4 workstations. I've written a component in VB to do this and here's the code:

Public Function ChangePassword(Username As Variant, Domain As Variant, _
            OldPass As Variant, NewPass As Variant) As Variant
   
    Dim o As IADsOpenDSObject
    Dim usr As IADsUser
   
    On Error GoTo ChangePasswordError
   
    Set o = GetObject("WinNT:")

    Set usr = o.OpenDSObject("WinNT://" & Domain & "/" & Username, Username, OldPass, 1)
    usr.ChangePassword OldPass, NewPass
    ChangePassword = "Ok"
    Exit Function
   
ChangePasswordError:
    ChangePassword = "Error: " & Err.Number & " " & Err.Description
   
End Function

Here's the code for the page I am testing this component with:
<!-- TestADSI.html -->
<%
     
     Dim objADSI, strMsg
     Set objADSI = Server.CreateObject("ADSIUtils.Class")
     
     'user=testuser
     'domain=coras
     'old password=Password123!
     'new password=Password456!
     strMsg = objADSI.ChangePassword("testuser","coras","Password123!","Password456!")
     
     Response.Write strMsg
     
     Set objADSI = Nothing
     
%>


When I call the page, I get the following error:
Error: -2147024843 Automation error The network path was not found.

The error occurs on the Set usr = .... line but I can't find any documentation on how to solve this problem. Any help would be so greatly appreciated!!!
0
Comment
Question by:cconway22
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 11

Expert Comment

by:thunderchicken
ID: 7075744
Did you register your component as an Administrator?

0
 
LVL 2

Expert Comment

by:shirjeel
ID: 7075802
Dear cconway22,

Check the permissions. Did all the users can access this component or not. secondly try from both logins i mean with administrator and a normal user login.

Regards
Shirjeel.
0
 

Author Comment

by:cconway22
ID: 7076133
I have compiled the component as an administrator and the permissions are fine. Even when I login as myself (a member of administrators) I get the error.
0
 
LVL 11

Expert Comment

by:thunderchicken
ID: 7076549
did you register in MTS as an administrator?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:cconway22
ID: 7078027
yes, it is registered in COM+ in an application that specifies to use the Administrator account but i still get the error.
0
 
LVL 2

Expert Comment

by:shirjeel
ID: 7078508
Dear cconway22,

Did u checked it b4 deploy. is it working fine? i think u should check its functionality once more. may be there is any problem within its programming

Regards,
Shirjeel.
0
 

Author Comment

by:cconway22
ID: 7078802
When I put the function into an executable, it works fine. Even when I call the function as a dll in a separate executable, it runs fine. The problem only occurs when I call the function from an asp page.
0
 
LVL 4

Expert Comment

by:Wakie
ID: 9211370
It appears this question has been abandoned.

I will leave a recommendation in the Cleanup topic area that this question will be:

- Question PAQ'd & Points refunded -

Please leave any comments here within the next seven days.

DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Wakie,
EE Cleanup Volunteer.
0
 

Accepted Solution

by:
YensidMod earned 0 total points
ID: 9259560
Question is PAQ' and points refunded.

YensidMod
Community Support Moderator @Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now