• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 345
  • Last Modified:

How to allow local win_2003_server users to change own password using VBscript and objUser.SetPassword ?

Hi,
I want to allow local win_2003_server users to change their own password
(from a web portal gui) using VBscript and objUser.SetPassword. But it is only
working if I'm logged in as admin user. Is their a server permission/security
setting for this?

Cheers
/Per
0
perhag
Asked:
perhag
  • 2
  • 2
1 Solution
 
Chris DentPowerShell DeveloperCommented:

Hey Per,

You can call the ChangePassword method (it requires the original password):

' Create a WinNT or LDAP connection to the user account

Set objUser = GetObject("LDAP://CN=Some User,OU=Some OU,DC=YourDomain,DC=local")

objUser.ChangePassword strOldPassword, strNewPassword


HTH

Chris
0
 
perhagAuthor Commented:
I got the same error with ChangePassword:  "general access denied error" code: 80070005 line:6
My vbscript look like this (and is working for admin users):

strComputer = "bkv-sas5"
strOldPassword = "ludde123"
strNewPassword = "ludde1234"
Set objUser = GetObject("WinNT://" & strComputer & "/156, user")
objUser.ChangePassword strOldPassword, strNewPassword
objUser.SetInfo

It there any difference calling the LDAP connection?

//Per
0
 
perhagAuthor Commented:
I got it :-) I don't need objUser.SetInfo now!
Seems to work now!

//Per

0
 
Chris DentPowerShell DeveloperCommented:

:-D

Chris
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now