????? ????? ???? ?????? ??? ?????? Windows 2000 ??? LDAP

?????? ????????? ?????? ?????????
???? ???????: 269190 - ??? ???????? ???? ????? ????? ??? ???????.
??????
????? ??? ??????? ??? Windows 2000. ????? ?? Windows 2000 ????? ?? 13 ????? 2010.Windows 2000 End-of-Support Solution Center ???? ????? ?????? ?????????? ??????? ????? ?? ?? ???? ??????? Windows 2000. ????? ?? ????????? ???? Microsoft Support Lifecycle Policy.
????? ???? | ?? ????

??????

????? ????? ???? ???? ???????? ?? Windows 2000 ???? ?????? ?????? ?????? ?????? ???????? (LDAP) ????? ??? ??????. ???? ??? ??????? ????? ????? ?? ????? ????? ???? ??????.

??????? ????

??? ????? ???? ?????? ?? "Active Directory" ??? ???? ?????? ?? ????? unicodePwd. ?? ???? ????? ??? ????? ???? ????? ???? ?? ???? ??????. ???? ????? ????? ???; ?? ???? ????? ??? ????? ???? ?? ????????? ???? ?????? ????? ???. ?????? ??? ????? ??? ?? ???? ??? ?????? ????? ???? ???? ????? ???? (SSL) 128 ?? ??? ??????. ???? ??????? ???? ??????? ??? ??? ?????? ?????? ????? ???? ?????? RSA 128-?? ?????? ??? ?? ??? ?? ?????? ?????? (CA) ???? ???? ????? ?????? ? ?????? ??????? ??? ?? ???? ????? ??? ????? 128-??.

????? ????? ???? ???? ???? ????? unicodePwd; ?? ???? ???? ???? ????? ?? ????? ????? ???? ??? ????? ??? ????? UNICODE (??? ???? ??? ??? ?????). ??? ?? ???? ??? ???? ?? ??? ??? ????? ???? ????? ?????? LDAP ????? UNICODE ??? ????? BER (????? ????? ?????) ???? ????? ????? ????. ???????? ??? ???? ????? UNICODE ??? ?? ???? ?????? ??????? ?????? ???? ????? ?? ???? ?????? ????????.

???? ??????? ???? ????? ????? unicodePwd. ???? ????? ???? "???????? ????? ???? ??????" ???????. ?? ??? ??????? ??? ?? ????? ????? ??? ????? ?? ??? ? ????? ?????. ????? ????? ??? ?? ????? ???? ?????? ??????? ?? ?????? ???????? ????. ??? ?? ????? ????? ????? ??????? ???? ?????? ??????? ?? ?????? ???????? ????.

??????? ??????? ?????? ??? ????? ????? ????? ????? ????? ???? ???? ??????. ?????? ????? ???? ??? ?????? ??????? ???? ???????? ??????? ?????? ???? ?????? ?????? ??????? ???. ??? ?? ????? ??? ??? ????? ????? ????? ??????? ???? ????? ?????? ???????? ?????? ?????? ????????. ??? ??? ?????? ???????? ??????? ???? ???? ?????? ??? ???? ?????? ??????? ??? ????? ?? ?? ???? ???? ?????? ???????.

???? ??????? ????? ??????? ????? ??? ????????:
ULONG ChangeUserPassword(WCHAR* pszUserDN, WCHAR* pszOldPassword,WCHAR* pszNewPassword)
{
	ULONG err = 1;
	LDAPMod modNewPassword;
	LDAPMod modOldPassword;
	LDAPMod *modEntry[3];
	BERVAL newPwdBerVal;
	BERVAL oldPwdBerVal;
	BERVAL *newPwd_attr[2];
	BERVAL *oldPwd_attr[2];
	WCHAR pszNewPasswordWithQuotes[1024];
	WCHAR pszOldPasswordWithQuotes[1024];

	// Build an array of LDAPMod.

	// For setting unicodePwd, this MUST be a double op.
	modEntry[0] = &modOldPassword;
	modEntry[1] = &modNewPassword;
	modEntry[2] = NULL;

	// Build mod struct for unicodePwd Add.
	modNewPassword.mod_op = LDAP_MOD_ADD | LDAP_MOD_BVALUES;
	modNewPassword.mod_type =	L"unicodePwd";
	modNewPassword.mod_vals.modv_bvals = newPwd_attr;

	// Build mod struct for unicodePwd Delete.
	modOldPassword.mod_op = LDAP_MOD_DELETE | LDAP_MOD_BVALUES;
	modOldPassword.mod_type =	L"unicodePwd";
	modOldPassword.mod_vals.modv_bvals = oldPwd_attr;


	// Password will be single valued, so we only have one element.
	newPwd_attr[0] = &newPwdBerVal;
	newPwd_attr[1]= NULL;
	oldPwd_attr[0] = &oldPwdBerVal;
	oldPwd_attr[1]= NULL;


	// Surround the passwords in quotes.
	wsprintf(pszNewPasswordWithQuotes,L"\"%s\"",pszNewPassword);
	wsprintf(pszOldPasswordWithQuotes,L"\"%s\"",pszOldPassword);

	// Build the BER structures with the UNICODE passwords w/quotes.
	newPwdBerVal.bv_len = wcslen(pszNewPasswordWithQuotes) * sizeof(WCHAR);
	newPwdBerVal.bv_val = (char*)pszNewPasswordWithQuotes;
	oldPwdBerVal.bv_len = wcslen(pszOldPasswordWithQuotes) * sizeof(WCHAR);
	oldPwdBerVal.bv_val = (char*)pszOldPasswordWithQuotes;


	// Perform single modify.
	err = ldap_modify_s(ldapConnection,
				pszUserDN,
				modEntry
				);

	if (err == LDAP_SUCCESS )
		wprintf(L"\nPassword succesfully changed!\n");
	else
		wprintf(L"\nPassword change failed!\n");

	return err;
}

ULONG SetUserPassword(WCHAR* pszUserDN, WCHAR* pszPassword)
{
	ULONG err = 1;
	LDAPMod modPassword;
	LDAPMod *modEntry[2];
	BERVAL pwdBerVal;
	BERVAL *pwd_attr[2];
	WCHAR pszPasswordWithQuotes[1024];

	// Build an array of LDAPMod.
	// For setting unicodePwd, this MUST be a single op.
	modEntry[0] = &modPassword;
	modEntry[1] = NULL;

	// Build mod struct for unicodePwd. 
	modPassword.mod_op = LDAP_MOD_REPLACE | LDAP_MOD_BVALUES;
	modPassword.mod_type =	L"unicodePwd";
	modPassword.mod_vals.modv_bvals = pwd_attr;

	// Password will be single valued, so we only have one element.
	pwd_attr[0] = &pwdBerVal;
	pwd_attr[1]= NULL;

	// Surround the password in quotes.
	wsprintf(pszPasswordWithQuotes,L"\"%s\"",pszPassword);

	// Build the BER structure with the UNICODE password.
	pwdBerVal.bv_len = wcslen(pszPasswordWithQuotes) * sizeof(WCHAR);
	pwdBerVal.bv_val = (char*)pszPasswordWithQuotes;


	// Perform single modify.
	err = ldap_modify_s(ldapConnection,
				pszUserDN,
				modEntry
				);

	if (err == LDAP_SUCCESS )
		wprintf(L"\nPassword succesfully set!\n");
	else
		wprintf(L"\nPassword set failed!\n");

	return err;
}
				

???????

???? ???????: 269190 - ????? ??? ??????: 11/????? ??????/1425 - ??????: 3.7
????? ???
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows 2000 Datacenter Server
????? ??????: 
kbmt kbhowto kbmsg KB269190 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????269190

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com