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. Database & SysAdmin
  3. System Admin
  4. Network shares & access control

Network shares & access control

Scheduled Pinned Locked Moved System Admin
c++csharpsysadmintoolstutorial
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.
  • R Offline
    R Offline
    Robin Imrie
    wrote on last edited by
    #1

    Hi Platform: XPPro/XPe Dev Tools: VS2005, VC++, ATL, .Net I have a service based application that requires to be able to access a network share using a unc path. There could be several unc paths on separate NT Domains. Whilst is is possible to assign a user on each NT Domain for my application to access the share I would like to, at run time pass in the domain\user name & password, so that my app can access the appropriate files. Each unc access will run in a separate thread and from reading the platform SDK docs it looks like I need to Set the token for this thread. However I can not find out how to convert my domain\user name & password in a token. can someone please point me in the right direction. Thanks. Robin

    M 1 Reply Last reply
    0
    • R Robin Imrie

      Hi Platform: XPPro/XPe Dev Tools: VS2005, VC++, ATL, .Net I have a service based application that requires to be able to access a network share using a unc path. There could be several unc paths on separate NT Domains. Whilst is is possible to assign a user on each NT Domain for my application to access the share I would like to, at run time pass in the domain\user name & password, so that my app can access the appropriate files. Each unc access will run in a separate thread and from reading the platform SDK docs it looks like I need to Set the token for this thread. However I can not find out how to convert my domain\user name & password in a token. can someone please point me in the right direction. Thanks. Robin

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      You need to call LogonUser to get a token. Then use ImpersonateLoggedOnUser to set the token for the thread. Once you've finished using the share, use RevertToSelf.


      DoEvents: Generating unexpected recursion since 1991

      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