Solved

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

Posted on 2006-10-23
6
333 Views
Last Modified: 2010-08-05
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
Comment
Question by:perhag
  • 2
  • 2
6 Comments
 
LVL 70

Accepted Solution

by:
Chris Dent earned 250 total points
Comment Utility

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
 

Author Comment

by:perhag
Comment Utility
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
 

Author Comment

by:perhag
Comment Utility
I got it :-) I don't need objUser.SetInfo now!
Seems to work now!

//Per

0
 
LVL 70

Expert Comment

by:Chris Dent
Comment Utility

:-D

Chris
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Numerous times I have been asked this questions that what is it that makes my machine log on so slow, there have been cases where computers took 23 minute exactly after taking password and getting to the desktop. Interesting thing was the fact th…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now