CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Nov 2008
    Posts
    5

    Logon failure with Win32 Service using Domain Account

    I am trying to install a local service under the context of a trusted domain account.

    I installed the service correctly and it starts fine running under the LocalSystem context, however the service fails to start under the domain account because of a logon failure.

    The domain account I am using meets all of the following requirements. Please tell me if I am missing anything:

    1). Account is enabled/unlocked
    2). Account password I am using is valid (logged into a few machines with it)
    3). Account has local admin rights on the machine I am installing the service on

    Attached is the CreateService() function I am using to install the service.

    Thank you

    Code:
         TCHAR szPath[MAX_PATH] = (L"\"C:\\Program Files\\Temp.exe\"");
         TCHAR szStartName[50] = (L"Domain\\User");
         TCHAR szStartNamePassword[50] = (L"**********");
    
          schService = CreateService( 
                schSCManager,
                SVCNAME,
                SVCNAME,
                SERVICE_ALL_ACCESS, 
                SERVICE_WIN32_OWN_PROCESS, 
                SERVICE_AUTO_START,
                SERVICE_ERROR_NORMAL,
                szPath,
                NULL,
                NULL,
                NULL,
                szStartName,
                szStartNamePassword);
    Last edited by ovidiucucu; November 16th, 2008 at 03:12 AM. Reason: added [CODE] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured