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. NetUserGetInfo returns 1008 (GetLastError)

NetUserGetInfo returns 1008 (GetLastError)

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

    Hi, I am developing a dll which uses NetUserGetInfo to retreive the home directory of a Domain user. NetUserGetInfo returns 1008 error code. my usage of function: NetUserGetInfo(Domain-server,domain-user,11,buf) The problem i was thinking was, The dll is launched by a local user(admin privilages) on a system which is in the same domain. SO may be the local user does not have enough permissions to use the NetUserGetInfo function to retreive the necessary information. My questions: 1. Is it possible to provide enough permissions for the local-user, How? 2. The other alternate is to connect to domain-server with some power user and then use the NetUserGetInfo function. But I do not find suitable function to connect to domain server with a power user credentials in windows network management API(netapi32.lib) Thanks for the help

    D 1 Reply Last reply
    0
    • G gbabu17

      Hi, I am developing a dll which uses NetUserGetInfo to retreive the home directory of a Domain user. NetUserGetInfo returns 1008 error code. my usage of function: NetUserGetInfo(Domain-server,domain-user,11,buf) The problem i was thinking was, The dll is launched by a local user(admin privilages) on a system which is in the same domain. SO may be the local user does not have enough permissions to use the NetUserGetInfo function to retreive the necessary information. My questions: 1. Is it possible to provide enough permissions for the local-user, How? 2. The other alternate is to connect to domain-server with some power user and then use the NetUserGetInfo function. But I do not find suitable function to connect to domain server with a power user credentials in windows network management API(netapi32.lib) Thanks for the help

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

      gbabu17 wrote:

      NetUserGetInfo returns 1008 error code.

      Which is ERROR_NO_TOKEN. What are Domain-server, domain-user, and buf? Do you have UNICODE and _UNICODE defined?


      "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

      "Judge not by the eye but by the heart." - Native American Proverb

      G 1 Reply Last reply
      0
      • D David Crow

        gbabu17 wrote:

        NetUserGetInfo returns 1008 error code.

        Which is ERROR_NO_TOKEN. What are Domain-server, domain-user, and buf? Do you have UNICODE and _UNICODE defined?


        "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

        "Judge not by the eye but by the heart." - Native American Proverb

        G Offline
        G Offline
        gbabu17
        wrote on last edited by
        #3

        they are passed to the function correctly, because i am printing them just before passing to the NetUserGetInfo.

        D 1 Reply Last reply
        0
        • G gbabu17

          they are passed to the function correctly, because i am printing them just before passing to the NetUserGetInfo.

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

          gbabu17 wrote:

          they are passed to the function correctly...

          But are they wchar_t or TCHAR types?


          "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

          "Judge not by the eye but by the heart." - Native American Proverb

          G 1 Reply Last reply
          0
          • D David Crow

            gbabu17 wrote:

            they are passed to the function correctly...

            But are they wchar_t or TCHAR types?


            "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

            "Judge not by the eye but by the heart." - Native American Proverb

            G Offline
            G Offline
            gbabu17
            wrote on last edited by
            #5

            They are wchar_t types. i think it is something related to permissions(may be ACL) but i cannot figure it out. thanks

            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