我有一个自定义的Active Directory密码过滤器DLL。
在两域DC(Windows Server 2012 R2)上,密码过滤器有时会收到带有美元符号($
)的用户名。
JSMITH
更改其密码。JSMITH$
更改了其密码。为什么会这样?
extern "C" __declspec(dllexport) NTSTATUS __stdcall PasswordChangeNotify(
_In_ PUNICODE_STRING UserName,
_In_ ULONG RelativeId,
_In_ PUNICODE_STRING NewPassword
)
{
// Set up process creation arguments
STARTUPINFO startupInformation;
PROCESS_INFORMATION processInformation;
ZeroMemory(&startupInformation, sizeof(startupInformation));
ZeroMemory(&processInformation, sizeof(processInformation));
// Prepare arguments
std::wstring arguments = std::wstring(UserName->Buffer)
+ L" "
+ std::wstring(NewPassword->Buffer);
// ...
唯一的用户名(在AD中又名sAMAccountName
属性)自动在末尾包含sAMAccountName
是针对计算机帐户的。 $
,因此它可能只是报告计算机已更新其密码。
我想也许computer accounts do actually have passwords只是一个示例,因为JSMITH$
听起来像是一个用户帐户。
但是,如果需要,您可以将JSMITH
明确放在用户名的末尾。