My C# application uses SMO to do various things with SQL Server instance chosen by a user. Particularly, it changes authentication mode:
ServerConnection conn = new ServerConnection(connection);
Server server = new Server(conn);
server.Settings.LoginMode = ServerLoginMode.Mixed;
After changing login more instance should be restarted. However, I cannot find any way in SMO to restart selected instance.
I've tried to google this, but only found a bunch of samples enumerating running services and comparing their names with SQL server service name. I did not like this way as it is error prone and relies on the way Microsoft currently names SQL server instances.
Is there any way to restart chosen instance in SMO?