Using LogonUSer API fails 
Author Message
 Using LogonUSer API fails

I am trying to verify a user in our NT Domain, but I get result as 0. This
use to work before but suddenly it stopped
can someone please help

Thanks
SS

'Here is the code
Public Function NTLogin(ByRef UserID As String, ByRef Password As String,
Optional ByRef Domain As String) As Boolean
    On Error GoTo ErrorHandler

    Dim lngResult As Long
    lngResult = LogonUser(UserID, Domain, Password, _
                    LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT, 1)

    NTLogin = lngResult
    Exit Function

ErrorHandler:
    NTLogin = False
    Dim sDescription As String
    sDescription = "Incorrect Login, Please try again..."
    Err.Raise Err.Number, Err.Source, sDescription
End Function



Fri, 03 Oct 2003 23:35:34 GMT  
 Using LogonUSer API fails
what's the last dll error you get (check app.lastdllerror)?



Quote:
> I am trying to verify a user in our NT Domain, but I get result as 0. This
> use to work before but suddenly it stopped
> can someone please help

> Thanks
> SS

> 'Here is the code
> Public Function NTLogin(ByRef UserID As String, ByRef Password As String,
> Optional ByRef Domain As String) As Boolean
>     On Error GoTo ErrorHandler

>     Dim lngResult As Long
>     lngResult = LogonUser(UserID, Domain, Password, _
>                     LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT, 1)

>     NTLogin = lngResult
>     Exit Function

> ErrorHandler:
>     NTLogin = False
>     Dim sDescription As String
>     sDescription = "Incorrect Login, Please try again..."
>     Err.Raise Err.Number, Err.Source, sDescription
> End Function



Sat, 04 Oct 2003 02:49:24 GMT  
 Using LogonUSer API fails
Try setting the policy "Act as part of the operating system" for the person
running the program.

Do note that this is a VERY dangerous privilege to grant - users that have
this privilege can basically bypass all the security checks in your system,
since they can add arbitrary groups (including administrator) to their
token.

Regards,
Pieter Philippaerts
http://www.allapi.net/



Quote:
> I am trying to verify a user in our NT Domain, but I get result as 0. This
> use to work before but suddenly it stopped
> can someone please help

> Thanks
> SS

> 'Here is the code
> Public Function NTLogin(ByRef UserID As String, ByRef Password As String,
> Optional ByRef Domain As String) As Boolean
>     On Error GoTo ErrorHandler

>     Dim lngResult As Long
>     lngResult = LogonUser(UserID, Domain, Password, _
>                     LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT, 1)

>     NTLogin = lngResult
>     Exit Function

> ErrorHandler:
>     NTLogin = False
>     Dim sDescription As String
>     sDescription = "Incorrect Login, Please try again..."
>     Err.Raise Err.Number, Err.Source, sDescription
> End Function



Sat, 04 Oct 2003 18:44:37 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Using LogonUSer API fails

2. LogonUser Fails

3. LogonUser API Impersonation to SQL Server

4. Createprocesswithlogon and LogonUser APIs

5. LogonUser API function - question

6. Trouble with LogonUser API

7. LogonUser API problem

8. Repost: Help with LogonUser API call needed

9. LogonUser API help

10. LogonUser API call help needed

11. LogonUser API

12. Pls Help! LogonUser API Problem

 

 
Powered by phpBB® Forum Software