I am trying to create users on an SQL server from an Active Directory group, because the application I am working with does not support Windows authentication and relies on separate logins created on the SQL server, since application-level permissions are controlled in the application, rather than using roles SQL In this regard, each user who needs to access the application needs to create his own user against the SQL instance in which the application database is located, so an individual permission can be assigned to the user in the application.
I am reading a list of users from the Active Directory group that we have assigned using the following:
exec master..xp_logininfo 'domain\groupname', 'members'
Returns output similar to the following:
account name type privilege mapped login name permission path DOMAIN\USER user user DOMAIN\USER DOMAIN\GROUPNAME
For the most part, users returned from this list can be created on an SQL instance without any drama. I create users as SQL accounts using sp_grantlogin in the first instance before moving on to allowing each new entry to the application database. However, several users are reported as non-existent. I get the following error as a result of running sp_grantlogin ;
Msg 15401, Level 11, State 1, Procedure sp_grantlogin, Line 49 Windows NT user or group 'DOMAIN\USER' not found. Check the name again.
Obviously, in the above error message, I deleted the actual username. Why xp_logininfo return a user that cannot be created using sp_grantlogin ? Is there something obvious that I'm missing?
user1451185
source share