c++ - Remote installing of windows service -


i need remotely install windows service on number of computers, use createservice() , other service functions winapi. know admin password , user name machines need access to. in order gain access remote machine impersonate calling process of logonuser this:

//all variables initialized correctly   int status = 0;         status = logonuser(lpwusername,                        lpwdomain,                             lpwpassword,                              logon32_logon_new_credentials,                           logon32_provider_default,                       &htoken);               if (status == 0)     {             //here comes error   }    status = impersonateloggedonuser(htoken);      if (status == 0)                 {          //once again error      }        //ok, impersonated, service work there 

so, gain access machine in domain, of computers out of domain. on machines out of domain code doesn't work. there way access service manager on machine out of domain?

you can , account needs exist on remote machine , need use machine name domain name in logonuser call.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -