Create windows AD login in SQL Server

Viewed 281

I have a domain with the name test.com and I have a simple query to add an account from this domain to the SQL Server Logins:

CREATE LOGIN [test.com\MyUser] FROM WINDOWS WITH DEFAULT_DATABASE=[DB]; 

But for some reason it fails with the error Windows NT user or group 'test.com\MyUser' not found. Check the name again..

When I specify the domain name without '.com' it works:

CREATE LOGIN [test\MyUser] FROM WINDOWS WITH DEFAULT_DATABASE=[DB]; 

What is the reason and how to make it working for both queries?

1 Answers
Related