Page 1 of 1 1
Topic Options
#38595 - 2003-04-01 05:47 AM Changing Passwords Under NT/2k
nichols Offline
Lurker

Registered: 2003-04-01
Posts: 1
I found a example code set on here that uses:
Function UserChangePass($oldpassword,$newpassword)

$UserID = GetObject("WinNT://@domain/@userid")

If @error = 0
$Userid.changepassword($oldpassword,$newpassword)
Exit(@error)
Else
Exit(5)
EndIf
EndFunction

Does this work for 2k? I've tried several times, to no avail.. It says it cant change it..

Top
#38596 - 2003-04-01 06:13 AM Re: Changing Passwords Under NT/2k
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
This works for me on an NT4 domain. I can't try it for 7 days on our AD domain because of the password policy.

This is the code I used:
code:
break on
$UserID = GetObject("WinNT://domain/account")
? "GetObject: @error @serror"

If @error = 0
$Userid.changepassword('123qweZXC','ABC123xyz!')
? "@error @serror"
Else
? "@error @serror"
EndIf

The error I get. I believe that it is as a result of the policy.
quote:

1 COM exception error "changepassword" ((null) - (null)) [1/1]

In your script you used @domain. Should you be using @ldomain?

[ 01. April 2003, 06:21: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 466 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.051 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org