Hello, dear friends.
So in this section, we're going to learn about user management, how to create log ins, and we're
also going to learn how to create users.
And how to create and manage roles.
So why don't we get started and we'll start with Longines?
So, again, you know, it's an identity used to connect to a SQL Server instance.
So the Create Logan statement will create an identity used to connect to ask you, well, server instance.
So what happens is Log-in is a map to a database user, so before creating a user Enescu all server,
you really must first create a login.
Now, each server log in is assigned one or more server roles that enable it to perform specific actions
on the instance.
So by default, server logins are assigned the public server role, which means gives basic access to
the instant.
But there are a few other available roles, and they include bulk admin, security admin, DB creator
and server admin.
And we're going to learn how to use some of those a little bit later.
So in this long in part, we will learn all about the Windows authentication and ask you, will server
authentication?
Windows credentialled.
So long and based on Windows credentials, allow users to log in to ask you all server using a Windows
username and password.
What about SQL Server authentication?
So I ask you, well, server authentication works by storing usernames and passwords on the database
server.
So how can we create escarole server authentication with a query?
Mm hmm.
Now, as you may remember from some of the previous sections, there are many processes that are done
in a couple of different ways.
The first way is with SSME GraphicLy and the second way is with a query.
And we're going to learn how to create a log in in both of these ways.
So let's jump in at SSME and create a log in GraphicLy.
So logins are located under the security folder and a security folder is a server level folder, which
is one of the parent folders in the instance.
And if we expand this folder, all the log ins that have been created before are listed right here.
As a log, an account is coming up with the setup of escarole server.
So now it's disabled and we can see the user Irini that I have connected to ask you all server with.
Now to create a new log in just where I click on the security folder and choose the new log in option.
New log in, painful up.
Now, all the settings of the log in can be seen right here and set on this pane.
The name of our log in will be test underscore, log in.
Now, right away, there are two options for Log-in, Windows Authentication and Escorial server authentication.
If we use a Windows authentication, we don't need to specify username and password because the login
will use the Windows username and password with this option.
But we want to create a login with Escorial server authentication.
So this is the option that we need to specify with a password and we can enforce the log in with password
policy with at least a letter.
And we can enforce password expiration or we can enforce the user to change the password at the very
first login.
Now, we can also assign any role to the log in.
Bulk admin, which is any member that can run the bulk insert command.
DB creator.
That allows any member to create, alter, drop and restore database's.
Desk admin will allow the member to manage Ezekial server disk files, process admin.
We'll give any member permission to kill process is running on escarole server.
And the public role sets the basic default permissions for all users.
Security admin means that any member can manage the server security server admin gives any member of
this role to set configuration options on the server.
Set up Edman.
And remember, with this role can manage linked servers and ask you all servers, startup options and
tasks, and of course, we have sysadmin, so any member with this role can perform any action on the
server.
So now we can choose the databases for the login with users mapping.
And now login permissions can be defined.
The status of the log in can be set to disable or enable.
We can click, OK, and that will create the longest.
All right, so here is our test log in.
We can also create a log in by query.
So create Log-in, new login with password equals just one, two, three, four or five, six.
Now, I kind of say that as a joke, but make sure to define a strong password if you're going to give
sysadmin or server admin roles.
Execute the query to create the log in.
And refresh the folder.
And here is our new log in.
Well done so.
And it's possible to rename a login so we can do this in a couple of different ways, graphically and
by query.
The altar log in command is used to change the name of the log in.
So we can alter login and the name of the login that we want to change its name to, and we will change
the name of the new login with a name phrase that should be used, and then finally, we will be able
to type the new name of the log in and let's call it new log in to.
Now, let's execute the query.
And I don't see an error, and here is the new log in to.
So we can also rename a login with just by right, clicking on the login, so then choose rename as
the option from the list and typed a new name and just press enter to accept.
And here it is.
Now we can change the password of login with the password parameter.
So we want to change or alter the password of the new login.
So we should use the password parameter and we should specify the new password.
And the password will change when we execute the query.
We can also change a password from a login properties Pop-Up window.
Specify a new password and click, OK?
And there you have it.
That's it.
Drop log in.
So what about when you have to drop a log in, as you know, we have used the drop command to delete
any object in escarole server.
So here we will define the name of the log in that we want to drop.
And we will drop new log in for the Log-in.
And if we execute the query, this whole organ will be dropped.
And we can also drop Log-in from Object Explorer with just a right click on the login that we want to
drop and then delete and OK.
And Leslie, let's enable the TSA log in to count.
So from the properties window, we will see the enable and disable settings under the status page.
Just choose, enable and save.
And that's it.