1

I have a requirement to create a simple windows forms application that allows an admin user to manage the Services on remote servers. We don't want to give the admins the usernames and passwords to the servers so these will be encrypted and stored in a database.

My question is whether or not it is possible to spawn a Services.msc window when impersonating one of the users stored within the database?

I have looked at the ProcessStartInfo class but because Services.msc is not an executable it does not seem to like executing this. Any ideas on a simple way of doing the actual impersonation and loading of Services.msc - say off a button click?

2 Answers 2

2

File extension msc is associated with mmc.exe. You'll want to start the following:

mmc.exe services.msc
Sign up to request clarification or add additional context in comments.

Comments

1

Spender was faster, so he gets the credits. Here is what I did, just in case it is useful to someone.

SecureString ss = new SecureString();
ss.AppendChar('X');
// other calls to AppendChar
ProcessStartInfo psi = new ProcessStartInfo() {
    UserName = "XXX", Password = ss, Domain = "XXX",
      UseShellExecute = false,
      FileName = "mmc", Arguments = "services.msc"
  };
Process.Start(psi);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.