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. C / C++ / MFC
  4. Current domain that the user is logged in into

Current domain that the user is logged in into

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
2 Posts 2 Posters 0 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.
  • C Offline
    C Offline
    Chintoo723
    wrote on last edited by
    #1

    I am trying to obtain the SID of the user currently logged in. I obtain the user name using GetUserName, and then the SID using LookupAccountName. This works, however the documentation of LookupAccountName says I must pass the "domain_name\user_name" for the lpAccountName parameter. Does anyone know how to obtain the domain_name of the domain the user is currently logged in? thanks!

    B 1 Reply Last reply
    0
    • C Chintoo723

      I am trying to obtain the SID of the user currently logged in. I obtain the user name using GetUserName, and then the SID using LookupAccountName. This works, however the documentation of LookupAccountName says I must pass the "domain_name\user_name" for the lpAccountName parameter. Does anyone know how to obtain the domain_name of the domain the user is currently logged in? thanks!

      B Offline
      B Offline
      Blake Miller
      wrote on last edited by
      #2

      You can try reading the USERDOMAIN environment variable... People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks

      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