My C # application uses SMO to perform various actions on a user instance of SQL Server. In particular, it changes the authentication mode:
ServerConnection conn = new ServerConnection(connection); Server server = new Server(conn); server.Settings.LoginMode = ServerLoginMode.Mixed;
After changing the login, you must restart the instance more. However, I cannot find a way in SMO to restart the selected instance.
I tried Google to do this, but found only a set of samples listing the services that were running and comparing their names with the SQL Server service name. I did not like this because it is error prone and relies on how Microsoft currently calls SQL server instances.
Is there a way to restart the selected instance in SMO?
sql-server smo
Alex
source share