Sunday, March 25, 2012

Changing Authentication Mode

How can I change the authentication mode for sqlexpress without going through the UI? I looked at the docs for sp_configure, dmo and smo but I may have missed it. I'd like to be able to run a script that changes the authentication mode of an installed sqlexpress instance from windows only to moxed mode.

ThanksYOU can either use the SMO classes for this (tell me if you need an additional smaple for this) or change the appropiate value in the registry. See my Screencast for that on my site in the Screencast section.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

This should work in SMO. You will need to restart the server after doing this.

Server s = new Server(); // default instance
s.Settings.LoginMode = ServerLoginMode.Integrated;
s.Settings.Alter();

Mike

|||...and restarting the service: http://msdn2.microsoft.com/en-us/library/ms162139.aspx

:-)

-Jens.|||Apparently I missed it. Thanks!

No comments:

Post a Comment