Try this one:
Func IsValidCredential($sUsername, $sPassword, $sDomain)
Local $LOGON32_LOGON_NETWORK = 3
Local $LOGON32_PROVIDER_DEFAULT = 0
Local $aRet = DllCall("advapi32.dll", "bool", "LogonUserW", _
"wstr", $sUsername, _
"wstr", $sDomain, _
"wstr", $sPassword, _
"dword", $LOGON32_LOGON_NETWORK, _
"dword", $LOGON32_PROVIDER_DEFAULT, _
"ptr*", 0)
If @error Then
ConsoleWrite("DLL call error: " & @error & @CRLF)
Return False
EndIf
If $aRet[0] Then
; Optional: close handle
DllCall("kernel32.dll", "bool", "CloseHandle", "ptr", $aRet[6])
Return True
Else
Return False
EndIf
EndFunc
$user=InputBox("username","username")
$dom=InputBox("domain","domain")
$pwd=InputBox("password","password","","*")
If IsValidCredential($user, $pwd, $dom) Then
MsgBox(64, "OK", "credentials accepted")
Else
MsgBox(16, "Failure", "credentials rejected")
EndIf