Based on the COM work from the COM forum, and the XLSinputbox; here is a simple script to reset a user account to a default 123456 and require the user to change it at next logon, and unlock it if the user locked it via bad attempts.
code:
break on
setconsole("hide")
$username=XlsInputBox("Enter Username to reset","User Reset",@userid)
$reset=Getuser($username)
;*************************************************************************************
function Getuser($user)
$userobj = getobject("WinNT://@LDOMAIN/$user,user")
if $userobj
$UserObj.IsAccountLocked = 0
$UserObj.PasswordExpired = 1
$userobj.setPassword("123456")
$userobj.SetInfo
$=sendmessage("@wksta","@error - @serror")
$userobj =0
else
$=sendmessage("@wksta","$user account not found")
endif
endfunction
function XlsInputBox( $prompt, optional $title, optional $default, optional $left, optional $top, optional $type)
dim $xls
$xls = createobject("excel.application")
if $xls
$xlsInputBox = $xls.inputbox($prompt,$title,$default,$left,$top,,,2)
if not $xlsInputBox quit endif
$xls.quit
$xls = 0
endif
endfunction