Trying to control Services on Remote Server

Steve Abaffy <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.winforms
Message-ID <00ba01c7b9b0$d110f2c0$7332d840$@biz>
Hello,

I have the following code:

ServiceController controller = new ServiceController();
controller.MachineName = "//ServerName";
controller.ServiceName = "SMTP";
string status = controller.Status.ToString(); // This line errors out with
the following error

Cannot open SMTP service on computer '//ServerName'.

If have tried using "Simple Mail Transfer Protocol (SMTP)" for the service
name with the same result. Is there something I am overlooking here???
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.