Solved

ADSI Problem

Posted on 2002-06-13
9
1,974 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

22 Experts available now in Live!

Get 1:1 Help Now