Jump to content
Sign in to follow this  

change ad user password, no admin rights

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")
Local $objUser, $username, $oldpw, $newpw

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


$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")
MsgBox(0,"","Password changed: " & $username)

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

Share this post

Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...