Mode d'authentification SQL Server
Submitted by st on
Comment vérifier et/ou changer le mode courant d'authentification SQL Server ?
On se connecte à une instance SQL Server et exécute le script :
USE master DECLARE @SmoLoginMode int EXEC xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', @SmoLoginMode OUTPUT PRINT @SmoLoginMode
Si @SmoLoginMode retourne "1" vous avez l'authentification Windows soit l'authentification mixe pour "2".
Vous pouvez changer ce mode dans SSMS (Propriétés du serveur - Sécurité) ou par TSQL :
USE master EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 1 -- ou 2
N'oubliez pas redémarrer l'instance SQL Serveur pour qu'il prenne en compte les modifications faits.