Windows Logins Basics

As most people would agree, Windows Authentication is the preferred authentication method in SQL Server as it provides consistency with your Windows or AD administration and it allows you to use groups for ease of administration if your users are organized into groups by security level and function.

To create a login in T-SQL use the following code:

CREATE LOGIN ‘AD\Ed’

To remove a login using T-SQL, use the following code:

DROP LOGIN ‘AD\Ed’

To deny a login using T-SQL, use the following code (NOTE: if the user or group does not exist in SQL Server, this command will add them first): 

 DENY CONNECT ‘AD\Ed’

This is a good foundation for a couple of other posts that I am working on for this week.  Enjoy!

Advertisements

About SQLGator

Florida Gator and Microsoft Data Platform MVP, Star Wars fanatic and is there anything else...oh yeah PS4! I am a geek and SQL Server DBA who dabbles with VMWare, there are other technologies greater than these? Not so fast my friend! I also love to travel to new and exotic places.

Posted on January 30, 2012, in Security and tagged , . Bookmark the permalink. Leave a comment.

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: