Solved

ADSI Problem

Posted on 2002-06-13
9
1,986 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

707 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