Passwort nicht änderbar
-
Hi,
ich versuche mein Passwort für diesen XP-Rechner auf ein neues zu ändern.
Die Funktion gibt mir jedoch als Rückgabewert bei FormatMessage immer
"Überlappender E/A Vorgang wird bearbeitet". Ich erhalte nicht wie laut MSDN
vorgesehen NERR_Success zurück.User und altes pwd sind jedoch richtig. Zum testen soll einfach mal das
neue pwd gleichzeitiges das alte sein...long rstatus= 0; CString user="meinlokaleruser"; CString pwd="meinlokalespwd"; rstatus= NetUserChangePassword(NULL, CT2W(user), CT2W(pwd), CT2W(pwd)); if (rstatus == NERR_Success) { MessageBox("pwd gefunden"); }
Kann mir jemand bestätigen, dass es wirklich "nicht" klappt?
Oder ist einfach nur wieder was falsch bedacht an dem Codefetzen?
-
Regmen schrieb:
neue pwd gleichzeitiges das alte sein...
Warum nimmst du zum Testen gleich ein Extremfall?
-
Es macht keinen Unterschied ob das neu gleich dem alten pwd ist.
Das ist mir klar. Es geht nur darum, dass es merkwürdigerweise nicht
funktioniert, egal was man im letzten Parameter angibt....
-
If the function fails, the return value can be one of the following error codes.
Return code DescriptionERROR_ACCESS_DENIED
The user does not have access to the requested information.
ERROR_INVALID_PASSWORD
The user has entered an invalid password.
NERR_InvalidComputer
The computer name is invalid.
NERR_NotPrimary
The operation is allowed only on the primary domain controller of the domain.
NERR_UserNotFound
The user name could not be found.
NERR_PasswordTooShort
The password is shorter than required. (The password could also be too long, be too recent in its change history, not have enough unique characters, or not meet another password policy requirement.)
-
In some cases, the process that calls the NetUserChangePassword function must also have the SE_CHANGE_NOTIFY_NAME privilege enabled; otherwise, NetUserChangePassword fails and GetLastError returns ERROR_ACCESS_DENIED. This privilege is not required for the LocalSystem account or for accounts that are members of the administrators group. By default, SE_CHANGE_NOTIFY_NAME is enabled for all users, but some administrators may disable the privilege for everyone. For more information about account privileges, see Privileges and Authorization Constants.
See Forcing a User to Change the Logon Password for a code sample that demonstrates how to force a user to change the logon
wie wärs mal mit lesen dann posten? meine fresse
-
Tja, ich bin Administrator auf dem Gerät und das Privileg ist enabled....
Warum fallen mir deine Postings eigentlich immer so auf?
Liegt es daran, dass du Ahnung zu haben scheinst, oder ist es mehr,
dass du in irgendeiner überheblichen Form deine Mitmenschen beleidigen
musst?Vielleicht ein Mix aus beidem?! Wenn dir deine "unfähige" Umwelt so
auf den Sack geht, dann tob dich doch bei WoW oder anderen desozialisierenden Spielen aus...man man man.