LogonUser API problem 
Author Message
 LogonUser API problem

How do I purposefully lock out a users NT account?
I've an agreement which new users to a 'restricted' have to read and
accept/decline before they can use the network.
If they decline, then the machine logs them out, using the
ExitWindowsEx(EWX_LOGOFF, 0) API.
However, my manager has asked if we can also lock their account out
automatically too.
The simplest way I can think of locking their account is to hit heir account
3 times in succession with a random password. But my implementation of the
API doesn't work. Am I doing this the right way?

Public Function LockAccount() As Long
    Dim i As Integer
    Dim lngTokenHandle, lngLogonType, lngLogonProvider As Long
    Dim passWord As String

    lngLogonType = LOGON32_LOGON_INTERACTIVE
    lngLogonProvider = LOGON32_PROVIDER_DEFAULT
    passWord = "1234abcd4321"

    For i = 0 To 2
        LockAccount = LogonUser(frmAccept.USRname, frmAccept.DOMname,
passWord, lngLogonType, lngLogonProvider, lngTokenHandle)
    Next i
End Function



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Pls Help! LogonUser API Problem

2. Pls Help! LogonUser API Problem

3. Pls Help ! LogonUser Api Problem

4. LogonUser API problem

5. LogonUser API with W2K- problems

6. LogonUser API Impersonation to SQL Server

7. Createprocesswithlogon and LogonUser APIs

8. LogonUser API function - question

9. Trouble with LogonUser API

10. Repost: Help with LogonUser API call needed

11. LogonUser API help

12. LogonUser API call help needed

 

 
Powered by phpBB® Forum Software