How To Add Back The BUILTIN Administrators Group In SQL Server
While disabling if you had dropped the
Built-in Administrator account from the SQL server. Please follow the
steps to add back The [BUILTIN\Administrators] group back.
First try in Test box, before doing any changes in Production box.
USE Master
First try in Test box, before doing any changes in Production box.
USE Master
Go
EXEC SP_Grantlogin 'BUILTIN\Administrators'
GO
EXEC SP_Defaultdb 'BUILTIN\Administrators', 'master'
GO
EXEC SP_Defaultlanguage 'BUILTIN\Administrators', 'us_english'
GO
EXEC SP_Addsrvrolemember 'BUILTIN\Administrators', 'sysadmin'
GO
The other way as well you can add like below.
USE Master
GO
CREATE LOGIN [BUILTIN\Administrators]
FROM WINDOWS
WITH DEFAULT_DATABASE=[master],
DEFAULT_LANGUAGE=[us_english]
GO
No comments:
Post a Comment