Add local windows Administrators group to SQL Logins

Adding Windows groups (local or domain) based security is best practice as it can help you in a situation where you loose credentials potentially.

You want to add Local Windows Administrators group to have SA or any other permissions in SQL. Ok you would think that it would be something like.

USE [master]
GO
CREATE LOGIN [<Server name>\administrators] FROM WINDOWS
GO

 

Not quite… the <Server name> needs to be replaced by the keyword BUILTIN as in below

USE [master]
GO
CREATE LOGIN [builtin\administrators] FROM WINDOWS
GO

Hope this saved you some headache today. Now you can proceed to define security for this group within SSMS or via TSQL

 

sql_server_management_studio_-_creating_a_login

 

 

 

 

 

Advertisements
About

IT professional with wider interest in technology

Tagged with: , , , ,
Posted in Active Directory, security, sql, SQL Server, tsql

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: