views:

126

answers:

2

Hi, 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?

Thanks

+1  A: 

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

mmc.exe services.msc
spender
+1  A: 

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);
Timores
Who's spencer? :)
spender
Ooops, sorry, I am too slow AND clumsy.
Timores