Changing Passwords
Keywords: changing passwords wntChgPswd n3ChgPassword n4ChgPassword
Question:
When logging into a netware file server, it does trap and report the error (information) that a users password has expired.I cannot see any means of changing the password.
Changing Passwords in Netware:
Use the following, with some editorial improvement ...AddExtender(... ErrorMode(@off) ; See cautions in manual LastError() n3Attach(... err=LastError() ErrorMode(@CANCEL) ; NEVER leave cancel disabled long if err==223 ;Expired pswd etc. endifUse n3ChgPassword to change it. You may need an updated version of WinBatch (at least 96F?). Download a new copy and try it out.
Question:
We are having a problem with the n4chgpassword command from the netware 4 extender. We are running a netware 4.1 network with users in multiple contexts. the problem is that the n4chgpassword command seems to pick up the users context from the default set in Client32, not from the context that the user has actualy logged into. If I can find out where the n4chgpassword command is getting the context from then I can update it with the current context before running the command. I have tried specifing the user name with the context eg. JBLOGS.SYDN.AUS but the n4chgpassword command will not work with this.Answer:
Like all the n4 functions (except the ones which take an explicit context parameter), it uses the default context, as is in effect when the extender is loaded (and case 98 is executed).In the DOS Netware client, this is set in NET.CFG (for Win3.x). In Win95 and NT, it's set in the properties for the Netware client via Control Panel, and is stored in the registry.
So make sure that the userid you're plugging into n4ChgPassword matches the correct context that is returned from n4GetContext.
Question on n4ChgPassword and Error 233: Unable to change the password
I'm getting error 233: unable to change password. I've checked the current context with n4GetContext and it matches what I've plugged into n4ChgPassword. I have all the rights, and can change the password manually. The error in WWW-BATCH.INI says:FFFFFD63 (NWDSChangeObjectPassword)Suggestions?Answer:
That error indicates an authentication failure. Double-check all the parameters, especially the user-name and old-password.Maybe try n4SetContext first.
Changing Passwords using DllCall to Password Dialog Box
Question:
I'm trying to utilize the Win95 password control DLLs to create an applet that will change my NT, NDS, and Win95 passwords with one swipe. I am using "DllCal"l to open the password change dialog box then I am trying to use "SendKeysTo" to pass keystrokes to the "Old Password", "New Password", "Retype Password" fields. However, after using "DllCall" to open the password dialog box the next line in my Winbatch program, which is the "SendKeysTo" line, does not execute until after I have either manually typed in the passwords or clicked on cancel at which time there is no dialog box left for my program to send the keystrokes to. Is there a way to open this dialog box by calling the DLL then have it release control back to my Winbatch program so the "SendKeysTo" line can process?Here are the 2 lines in question:
DllCall("c:\windows\system\mpr.dll", void:"PwdChangePasswordA", lpstr:"MSNP32", lpnull, long:0, long:0) SendKey(`oldpassword{TAB}newpassword{TAB}newpassword{ENTER}{ENTER}`)I would like to use a dialog box that I've created to ask the user for the old password and new password, assign their responses to variables then use the value of those variables as the input for "OldPassword" and "NewPasword" in the part of the program that you helped me with. The variables that I'm using in the dialog box are; PW_oldpw, PW_newpw, and PW_repw. Is there a way to use the value of these variables in the "SendKeysTo" section of this program?Answer:
You can turn the script around so that the second script that runs runs the DllCall and the first part does the SendKeysto.Or, keep the script as it is and pass the information as additional parameters in the Run statement, and then these parameters will be used in the Sendkeysto section as param2 and param3.
Here's what I mean:
if param0!=0 SendKeysTo("~Change Pass",`%param1%{TAB}%param2%{TAB}%param2%{TAB}{ENTER}`) exit endif while 1 MyDialogFormat=`WWWDLGED,5.0` MyDialogCaption=`Password Box` MyDialogX=16 MyDialogY=32 MyDialogWidth=200 MyDialogHeight=129 MyDialogNumControls=8 MyDialog01=`114,28,64,DEFAULT,EDITBOX,PW_oldpw,""` MyDialog02=`114,46,64,DEFAULT,EDITBOX,PW_newpw,""` MyDialog03=`114,64,64,DEFAULT,EDITBOX,PW_RePW,""` MyDialog04=`34,96,64,DEFAULT,PUSHBUTTON,DEFAULT,"OK",1` MyDialog05=`116,98,64,DEFAULT,PUSHBUTTON,DEFAULT,"Cancel",0` MyDialog06=`34,28,64,DEFAULT,STATICTEXT,DEFAULT,"Old Password"` MyDialog07=`34,48,64,DEFAULT,STATICTEXT,DEFAULT,"New Password"` MyDialog08=`34,64,76,DEFAULT,STATICTEXT,DEFAULT,"Retype New Password"` ButtonPushed=Dialog("MyDialog") if PW_newpw != PW_RePW Message("Ooopsie","New passwords do not match. Try again") else break endif endwhile moi=IntControl(1004,0,0,0,0) Run(WinExeName(""),strcat(moi, " ", PW_oldpw, " ", PW_newpw) ) DllCall("c:\windows\system\mpr.dll", void:"PwdChangePasswordA",lpstr:"MSNP32", lpnull, long:0, long:0)
Article ID: W13588Filename: Changing passwords in Netware and n4ChgPassword.txt