473,320 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

windows service Logon credentials change

Hi All,

we have four app servers and 5 services are installed in each machine.
For every 60 days we need to change winodws domain users passwords, which
the services run.

Is there any way we can grab the service programatically and change service
logon credentials using C# utility?
I can loop through all services installed on the machine using the following
code.

foreach(ServiceController sc1 in ServiceController.GetServices())
{
MessageBox.Show(sc1.DisplayName.ToString());
}

But I don't know how to change service logon credentials.
Do you guys have any idea?
Thanks
Anil
Nov 17 '05 #1
1 8536

"Anil" <An**@discussions.microsoft.com> wrote in message
news:7C**********************************@microsof t.com...
Hi All,

we have four app servers and 5 services are installed in each machine.
For every 60 days we need to change winodws domain users passwords, which
the services run.

Is there any way we can grab the service programatically and change
service
logon credentials using C# utility?
I can loop through all services installed on the machine using the
following
code.

foreach(ServiceController sc1 in ServiceController.GetServices())
{
MessageBox.Show(sc1.DisplayName.ToString());
}

But I don't know how to change service logon credentials.
Do you guys have any idea?
Thanks
Anil


Why not simply use the command line utility 'sc.exe' provided by the system
for this?

This command:
sc \\serverX config SomeService password= xxxx

changes the password of the service SomeService on serverX

Willy.
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mullin Yu | last post by:
hi, i want to write a windows service automatically logon to a network computer so that after re-starting the computer without logon, the computer can logon to that computer and can use its...
7
by: Mullin Yu | last post by:
if i put the same code at the windows application or console, i can logon to the computer. but, if i put the same code at the windows service and start it, i still can't logon to the machine. ...
3
by: Jeremy S. | last post by:
On my dev machine (XP/Pro with VS.NET 2003) I have been developing a Windows Service and installing it on the local machine by opening the Visual Studio Command Prompt and then executing . Now I...
5
by: Nirosh | last post by:
Hi All, Can any one suggest me a best way to do this .. I have a thrid party tool "EXE" that we need to use with our web service to manipulate some complex XML files, which reside in a...
1
by: Zachariah | last post by:
I created a Windows Service and part of its functionality is to move a PDF file from a location on the service's local drive stInPath (C:\PDF\) to a location on another server stOutPath...
3
by: tshad | last post by:
I have my windows authentication on our intranet set up as: <authentication mode="Windows"/> This works for 15 machines at work fine. Doesn't ask you to logon. It uses the logon credentials...
6
by: =?Utf-8?B?UGFyYWcgR2Fpa3dhZA==?= | last post by:
Hi All, We have a requirement where we have to develop a custom Login Page which will accept user's NT credentials ( Username , password, domain name). This then needs to be passed to a website...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.