Sql-server – Adding a domain user in SQL Server Management Studio

sql serverssmst-sql

Before I ask my question, let me mention that my SQL Server is installed on a member server of a domain (it belongs to the domain but is not an AD server).

I am having trouble adding a network user in SQL Server Management Studio.

First I tried adding user by right-clicking security and clicking new -> login. I wanted to add a network user, so i clicked locations. But only the name of the local server was showing. I was unable to browse my domain users (at that time I was logged in through a network user on my SQL Server machine).

So I tried another approach. I tried to add a network user through Transact-SQL as follows:

create login [domain\user] from windows;

But I got an error message saying – Windows NT user or group not found – even though the user existed on my domain server.

What am I doing wrong?

Best Answer

For me it worked to generate a script with SSMS.

USE [master]
GO
CREATE LOGIN [domain\user] FROM WINDOWS WITH DEFAULT_DATABASE=[master]
GO
ALTER SERVER ROLE [role] ADD MEMBER [domian\user]
GO