Solved

ADSI Problem

Posted on 2002-06-13
9
1,983 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 11

Expert Comment

by:thunderchicken
ID: 7076549
did you register in MTS as an administrator?
0
 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Copy only dates 3 94
can I post data from an asp page to php page? 4 57
Html Table looping 4 26
asp classic find word in string and get its value 7 22
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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

830 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