Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Log Off Network Users Problem

[b][red]This message was edited by ScoobFan at 2004-3-31 3:33:3[/red][/b][hr]
Hi

I have a bit of a dilema. I need to log off users on a network from my pc. I wrote code to reboot the computers, giving a warning message that the computer will stud down etc. The method I used was "InitiateSystemShutdown". It gives a problem though, some of the keyboards cant use cntrl,alt or delete keys.

So, is there anyone out there that knows how to log off the computers, and not restart them as its giving problems. I thought that I could run the logoff.exe file on their computer, but it just logged me off!!

Please help!


Comments

  • Srki_KiSrki_Ki Posts: 26Member
    I'm have very little expiriece with network programming bu i think you can use this functions:

    [code]
    function NetSessionEnum(servername: LPWSTR;
    UncClientName: LPWSTR;
    username: LPWSTR;
    level: DWORD
    bufptr: Pointer;
    prefmaxlen: DWORD;
    entriesread: LPDWORD;
    totalentries: LPDWORD;
    resume_handle: LPDWORD): integer;


    function NetSessionDel(servername: LPWSTR;
    UncClientName: LPWSTR;
    username: LPWSTR): integer;
    [/code]

    These functions can be found in [b]netapi32.dll[/b]. I have never used these functions so i cann't help you more. There is good help and some samples in MSDN.
  • ScoobFanScoobFan Posts: 5Member
    Thanx, will give it a try!

    : I'm have very little expiriece with network programming bu i think you can use this functions:
    :
    : [code]
    : function NetSessionEnum(servername: LPWSTR;
    : UncClientName: LPWSTR;
    : username: LPWSTR;
    : level: DWORD
    : bufptr: Pointer;
    : prefmaxlen: DWORD;
    : entriesread: LPDWORD;
    : totalentries: LPDWORD;
    : resume_handle: LPDWORD): integer;
    :
    :
    : function NetSessionDel(servername: LPWSTR;
    : UncClientName: LPWSTR;
    : username: LPWSTR): integer;
    : [/code]
    :
    : These functions can be found in [b]netapi32.dll[/b]. I have never used these functions so i cann't help you more. There is good help and some samples in MSDN.
    :

  • ScoobFanScoobFan Posts: 5Member
    I downloaded the netapi32.dll, copyied it into my windows stsyem folder & tried to register it. It said the dll cant be registered. I used the "regsvr32 netapi32.dll" in the run command to register it. Its been a while since I last registered a dll, am I doing it correctly?

    Any help appreciated!
    Thnx
  • Srki_KiSrki_Ki Posts: 26Member
    Every Windows have netapi32.dll in System or System32 folder. If you cann't find (or register) netapi32.dll, try using netapi.dll. It is 16-bit version of netapi32.dll.
Sign In or Register to comment.