Login into SQL Server 2014 using windows groups - sql-server

I have an domain admin user group and I have added it to SQL Server security. My account is added to the group. But I am not able to log in to SQL Server.
If I add my domain account individually to SQL Server, I can login using my Windows account. Can I login into SQL Server via a user group so I do not have to add the each individual account?

Yes, you can. All that is required is to add the windows ad group to whatever role is appropriate to your configuration.
SQL Server supports three types of logins:
A local Windows user account or trusted domain account. SQL Server
relies on Windows to authenticate the Windows user accounts.
Windows group. Granting access to a Windows group grants access to
all Windows user logins that are members of the group.
SQL Server login. SQL Server stores both the username and a hash of
the password in the master database, by using internal authentication
methods to verify login attempts.
Read more here MSDN SQL Authentication
And this article has step by step with screen shots: Step By Step

You can use Windows Authentication Mode, first you need to make sure that the user's identity is verified by Windows then SQL Server validates the account name and password using the Windows principal token in the operating system.
Read more: https://msdn.microsoft.com/en-us/library/ms144284.aspx

Related

Using Windows Authentication and SQL Server database

Do you know whether a SQL Server connection can be authenticated via Windows Authentication but using a not exclusively the Windows Identity/Windows User Name but also a DB login name?
That is, could an SQL Server database have a login that is mapped to a Windows ID so that when you request a database connection you can specify a user name but yet SQL Server knows to look at the Windows authentication ID and validate the login?
could an SQL Server database have a login that is mapped to a Windows ID so that when you request a database connection you can specify a user name but yet SQL Server knows to look at the Windows authentication ID and validate the login?
No. When you connect with Windows Integrated Authentication you'll be connected as a Windows Login, and for each database you execute statements as the user mapped to that Windows Login (or as dbo if the login is a member of the sysadmin server-level role or the Windows Login is the owner of the database).
You can grant that Windows Login or mapped user the privilege to impersonate some other login or user, but it requires a separate command to perform the impersonation (execute as user='someuser'.

Windows Groups in SQL Server

Is there a prohibition for using a Windows Group account (with users) and mapping them to a credential in SQL Server.
I was able to make this work with an Windows Login Account and I believe this will work well with SQL Accounts.
Running the following:
ALTER LOGIN [DOMAIN\GROUP_NAME] FROM WINDOWS
ADD CREDENTIAL [credentialname];
GO
I get the following error:
Cannot use parameter CREDENTIAL for a Windows login. error 15080
Adding a credential to a Login is used to give a Windows identity to a SQL Login for interacting with external resources, typically in CLR code or Linked Servers.
CREDENTIAL = credential_name The name of a credential to be mapped to
a SQL Server login. The credential must already exist in the server.
For more information, see Credentials. A credential cannot be mapped
to the sa login.
ALTER LOGIN
It's not intended, documented, or supported for Windows Logins of any kind, and doesn't actually work.

Microsoft Access: connecting to SQL Server via Active Directory username and password Trusted_Connection=no

I have a Microsoft Access Application which generates a connection string like:
Provider=SQLNCLI11;Server=servername;Database=db_name;Trusted_Connection=yes;
This works without any problem.
What I want to do is to connect to a SQL Server instance where the user must insert his Active Directory name and password.
Like this:
Provider=SQLNCLI11;Server=servername;Database=db_name;Uid=username;Pwd=password;
This only works for users which are created on the SQL Server directly.
I tried Uid=DOMAIN\username, but it isn't working.
Is this possible? Or is there another way how I can get through this?
The environment:
The User is using a local PC with a local account and then he's doing a "NetworkConnect" with his AD-User and password.
After that, "RunAs" as his AD-User is working BUT there is another Application that is started from the Access Application and this App must be started with the local User-Account.
SQL-Server and the AD-User are member of the same domain.
Your choices are
Login to SQL Server using your the Windows Domain account that you are currently logged into. You do this automatically by specifying Trusted_Connection=yes;, or
Login to SQL Server using a SQL Login.
Those are the only two choices possible using a SQL provider connection string. Specifically, you cannot use the SQL access provider to do impersonation, that is, to login to SQL Server using a different Windows domain account than the one that you are currently logged into.
Microsoft designed the AD integration with SQL Server to use the account of the client application, not to be able to handle logging in as a part of the connection string. If the user isn't going to be logged into the machine using the account needed for the database access, the next best option may be something like ShellRunAs in order to let the user run your client app as the correct AD account.

Difference between Windows Authentication and SQL Authentication - Views, security, databases

Could somebody explain how you can have different databases/security when connecting in via Windows Authentication from when someone connects via SQL authentication?
I have a customer who had to put a computer onto their network. When they did this, the computer name changed. When connecting into SQL it now has a different server name.
The thing is if I connect using a SQL username and password, I get the databases that were installed before. However If I connect using windows authentication, I do not get the database.
I would like to know what needs to be changed in order for windows authentication to see the same as a user logging in via SQL authentication.
How can I go about changing the permissions of windows authentication?
Within SQL Server, there are Logins (at the server level) and Users (at the database level). Your SQL Server login obviously has permission to the database(s) you want to see. The logins can also be windows users and/or groups. So, if you add a named windows user as a server login, you can extend that login as users in different databases. You can do the same thing with a group. So, you could have a single login to your sql server that represents all authenticated users in your domain, etc...
So, I think you need to get into SSMS (SQL Server Management Studio) and see what logins and users are defined on your SQL Server.

Unable to create new DataBase in MS Sql Management Studios

I do not remember the serverauthentication password, so I am using windows authentication. I am not able to do anything.
You need to fulfill the following requirements:
you must be a member of Local Administrators group on the computer where the SQL Server is running.
The SQL Server service must be run under the LocalSystem account.
In this case, when connecting using Windows Authentication, you can check if you have any permissions (check the Logins sub-section of the Security section in the SSMS. If the NT AUTHORITY\SYSTEM is shown there, you can add the needed database. Otherwise you need to bethink the sysadmin login & password.

Resources