Jump to content

change ad user password, no admin rights


 Share

Recommended Posts

Hi guys,

not sure if i am at the place here, but that's my first post. :)

I m having the following issue: i m trying to change an ad user password, provided that i know the current one (no admin rights).

The following code is perfectly working when I change my personal pass, when logged in with my username of course.

(username and both passwords stored in an ini file)

Local $var = IniReadSection(@ScriptDir & "\param.ini","account")
;MsgBox(0,"",@ScriptDir)
Local $objUser, $username, $oldpw, $newpw

If @error Then
MsgBox(4096, "", "Error occurred, probably no INI file or wrong path.")
Else
$username = $var[1][1]
$oldpw = $var[2][1]
$newpw = $var[3][1]


EndIf

$objUser = ObjGet("LDAP://cn=" & $username & ",OU=T-Account,OU=User,OU=Administration,dc=dekager,dc=dekabank,dc=intern")
MsgBox (0,"",@UserName & " " & $objUser.displayname)
$objUser.ChangePassword($oldpw, $newpw)
if @error Then
MsgBox(4096,"","Error occured")
Else
MsgBox(0,"","Password changed: " & $username)
EndIf

But when I tried the same code with another user account (logged in as that user) all I got was an error message, namely my error message "error occured".

I really don't see any reasonable explanation, so any help would be much appreciated :)

Thank u in advance

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...