I have a win7 box and a win2008r2 box. Not sure if this is related to my problem, but the win2008r2 server has KB3177108 installed. Win7 does not have this patch.
When I run this program on Win7, it works (returns status_success and changes the password). When I run this on win2008r2, it fails with error 87 - invalid parameter, but it also successfully changes the password...
What am I doing wrong here?
Thanks for looking at this...
#include "windows.h"
#include <LM.h>
#include <stdio.h>
int wmain(int argc, wchar_t * argv[])
{
DWORD error = NetUserChangePassword(
L"mydomain",
L"lowlyuser",
L"oldpassword",
L"newpassword"
);
wprintf(L"Error = %d\n", error);
return error;
}