Re: Retrieving account starting service by Luc
Luc
Sat Mar 26 12:17:20 CST 2005
Damn, you are right. Although I wrote services in .NET, I still use the
management tools (in plain C) I wrote for the SCM at the time of the first
beta of NT circa 1991/1992...
I see the ServiceInstaller has the Account/Username/Password info, but no
way to connect that to an existing service.
Let's hope someone else come on with a pure .NET solution (if it is
possible). You can of course use the SCM interface with PInvoke.
/LM
"Bill Richards" <BillRichards@discussions.microsoft.com> wrote in message
news:D8981676-B1AA-47E2-84CE-60736028A3BC@microsoft.com...
> That's what I'm using now, but I can not find how to access what account
> is
> starting the services. The ServiceController returns everything else, but
> not
> the account that starts the service.
>
> Bill
>
> "Luc E. Mistiaen" wrote:
>
>> You should use the service controller manager to perform all services
>> related queries/changes.
>> Look at the System.ServiceProcess.ServiceController Class for a start.
>>
>> /LM
>>
>> "Bill Richards" <Bill Richards@discussions.microsoft.com> wrote in
>> message
>> news:EE4E37C8-AAE0-424B-84FF-DF0B0B8B2C5E@microsoft.com...
>> > I'm trying to write an application to enumerate all the services
>> > running
>> > on
>> > all of the servers in the company I work for. I've got it working
>> > except
>> > that
>> > I have not been able find how to pull the account that starts the
>> > service.
>> > This is important because once I know this info for all the servers, I
>> > have
>> > to write an app that will periodically change the passwords used by the
>> > accounts starting these services. I don't want to logon to all of these
>> > servers individually to do this. I've been able to get the information
>> > from
>> > many of the servers by pulling the info from the registry, but many of
>> > the
>> > servers have remote registry disabled.
>>
>>
>>