Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Service to Logoff/Disconnect/Reboot Computer System

Service to Logoff/Disconnect/Reboot Computer System

Scheduled Pinned Locked Moved Visual Basic
databasewindows-adminquestion
1 Posts 1 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stefan Robin
    wrote on last edited by
    #1

    I have a service that will perform some kind of action depending on what the SessionChangeDescription is. The service is installed on a computer that autologs in. To make this happen this registry value needs to be set and is set during OnStart: Key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon Value: AutoAdminLogon Data: 1 There is a Windows Form that will allow a domain user to log in and the service will change the AutoAdminLogon value to a 0. When a power outage occurs and power is restored the PC, the computer does not autologon cause the registry value AutoAdminLogon is not set back to a 1 yet. I normally just send a logoff, tsdiscon, or restart to the computer through SCCM and it will autolog again. These are my questions: 1. Is it possible to logoff or disconnect a session through the service at a logon screen? 2. Is it possible to trigger one of the SessionChangeDescription without any session changes? 3. Restart the computer through the service? What I have tried: At OnStart, get the AutoAdminLogon value and if it a 0, then do one of these: ExitWindowsEx function, WTSDisconnectSession function, wmi to logoff a session, tsdiscon.exe, logoff.exe, shutdown.exe, and LockWorkstation function. None of them work. If I do the same through SCCM, the computer autologs in.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups