'Script to change SQL Security Mode to Mixed 'JSmith 09/01/2002 Const cSQLServer = "(local)" 'supply your servername Const SQLDMOSvc_Running = 1 Const MixedModeSec = 2 Dim oSQL,oSEC,oSQL2 Set oSQL = WScript.CreateObject("SQLDMO.SQLServer") oSQL.Name = cSQLServer oSQL.LoginSecure = True oSQL.LoginTimeout = 10 If oSQL.Status <> SQLDMOSvc_Running Then oSQL.Start True,cSQLServer Else oSQL.Connect End If 'Set security mode to mixed Set oSEC = oSQL.IntegratedSecurity oSEC.SecurityMode = MixedModeSec On Error Resume Next ' prevent disconnect error oSQL.Shutdown False Err.Clear WScript.Sleep 5000 ' give the service a chance oSQL.DisConnect If oSQL.Status <> SQLDMOSvc_Running Then oSQL.Start True,cSQLServer End If If oSEC.SecurityMode = MixedModeSec Then varmess = "Server Authentication is now mixed" Else varmess="Unable to change Authentication Mode" End If oSQL.DisConnect Set oSEC=nothing Set oSQL=nothing msgbox varmess