how to success OpenScManager for local machine when logged in with a user don't have administrator privileges



Hello All,

I logged in as a local user which do not have administrator privileges on
Vista. Then I tried to use:

LogonUserA(user, domain, password, LOGON32_LOGON_NEW_CREDENTIALS,
LOGON32_PROVIDER_WINNT50, &token);
ImpersonateLoggedOnUser(token);
OpenSCManagerA(machine, NULL, SC_MANAGER_CREATE_SERVICE);

It successed when the target machine is a remote machine, but failed for the
machine itself.
I guess LOGON32_LOGON_NEW_CREDENTIALS use the credentials I put for the
remote connection but not for the local, so I have tried change
LOGON32_LOGON_NEW_CREDENTIALS to some other values but it can't work.

Is there some other solution for this?

Thanks,
tianc


.



Relevant Pages

  • How to add/remove local users on a remote machine
    ... remote machine, and one for removing a local user on a remote machine. ... How do I create a local user on a remote machine which is not a member of my ...
    (microsoft.public.vb.winapi.networks)
  • Re: How to add/remove local users on a remote machine
    ... > I have a class with a couple of functions, one for adding a local user on a> remote machine, and one for removing a local user on a remote machine. ... I'm getting a "General> access denied error." ... > I've tried using LogonUser and impersonation, but since most of the remote> machines I need to access are not a member of the same domain as mine, that> does not seem to be working for me either. ...
    (microsoft.public.vb.winapi.networks)
  • Re: How to add/remove local users on a remote machine
    ... These newsgroups tend to be pretty agnostic to ... API and are the ... do this that doesn't require a domain or forest trust to the remote machine, ... >> I have a class with a couple of functions, one for adding a local user ...
    (microsoft.public.vb.winapi.networks)
  • Re: how to start up vncserver w/o login?
    ... they had got freenx or!M to make a connection to the native desktop on ... a remote machine without any local user having logged in on the remote machine ... This particular use for connection to a remote desktop is vital for me to ... manage a remote machine where the local user there is non-computer literate. ...
    (Fedora)
  • Re: Joining Vista Prof. to domain
    ... Basically the fault and the resolution lies with the W2K8 and not with vista ... I have a vista pro machine. ... local user signs on builds the desktop quickly. ... quickly, then asks to reboot.. ...
    (microsoft.public.windows.vista.general)