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. LOGON Problem

LOGON Problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpsysadminjsonquestion
5 Posts 3 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.
  • M Offline
    M Offline
    M Mehrdad M
    wrote on last edited by
    #1

    Hi, There. I Wrote a service in XP, That runs a program. For Network Access I need to logon as specific user. Have anybody An idea, suggestion,link,API,help ... ?:confused: Logon Can Be on local or remote computer. Thanks,

    2 D 2 Replies Last reply
    0
    • M M Mehrdad M

      Hi, There. I Wrote a service in XP, That runs a program. For Network Access I need to logon as specific user. Have anybody An idea, suggestion,link,API,help ... ?:confused: Logon Can Be on local or remote computer. Thanks,

      2 Offline
      2 Offline
      224917
      wrote on last edited by
      #2

      Check the lpServiceStartName parameter of CreateService()[^]. Make sure this user has access to to required network resource.


      suhredayan
      There is no spoon.

      M 1 Reply Last reply
      0
      • 2 224917

        Check the lpServiceStartName parameter of CreateService()[^]. Make sure this user has access to to required network resource.


        suhredayan
        There is no spoon.

        M Offline
        M Offline
        M Mehrdad M
        wrote on last edited by
        #3

        Thanks a lot But, Do You Mean That I Can LogOn To System via CreateService() ? i.e I Can Determine the UserName and Password In this Function !!!Or a service Can Act As Users? It is Something new for ME, Would you pls, Discuss A little about your Idea?

        2 1 Reply Last reply
        0
        • M M Mehrdad M

          Thanks a lot But, Do You Mean That I Can LogOn To System via CreateService() ? i.e I Can Determine the UserName and Password In this Function !!!Or a service Can Act As Users? It is Something new for ME, Would you pls, Discuss A little about your Idea?

          2 Offline
          2 Offline
          224917
          wrote on last edited by
          #4

          M.Mehrdad.M wrote: Do You Mean That I Can LogOn To System via CreateService() By default when you double click a exe it runs under the same user account by which you logged on the the system. But a service starts executing before a user login to the system. So you have to say to the system, under which user account the service should be run, this should be done while the service is created/registered to the system. CreateService() is the API to Create/register the service with the system and lpServiceStartName & lpPassword are parameters through you say to the system, under which user account the system should run your application as service.


          suhredayan
          There is no spoon.

          1 Reply Last reply
          0
          • M M Mehrdad M

            Hi, There. I Wrote a service in XP, That runs a program. For Network Access I need to logon as specific user. Have anybody An idea, suggestion,link,API,help ... ?:confused: Logon Can Be on local or remote computer. Thanks,

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Is LogonUser() what you are looking for?


            "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

            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