Thursday, March 22, 2012

Authentication Mode question from a command line junkie

What is the syntax from to change the authentication mode from inside of the server(ie: osql)? And what system tables can be queried to identify which mode the server is currently running in?
To check the mode use
select serverproperty('IsIntegratedSecurityOnly')
or
exec master..xp_loginconfig 'login mode'
You can use the undocumented xp_regwrite/xp_instance_regwrite to change the
registry key that contols this (which is what EM does anyway) or use SQLDMO
but it needs a SQL Service restart to take effect e.g.
exec master..xp_instance_regwrite N'HKEY_LOCAL_MACHINE',
N'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer',
'LoginMode', N'REG_DWORD', 2
'Set security mode to mixed where oSQL is a SQLServer object
Set oSEC = oSQL.IntegratedSecurity
oSEC.SecurityMode = 2
0 or 2 = Mixed
1 = NT only
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Dean" <anonymous@.discussions.microsoft.com> wrote in message
news:C3B38A1E-32D5-4891-947F-56E5A9857A30@.microsoft.com...
> What is the syntax from to change the authentication mode from inside of
the server(ie: osql)? And what system tables can be queried to identify
which mode the server is currently running in?
sql

No comments:

Post a Comment