Thursday 19 January 2012

Creating a user on SQL server which maps to a computer account

Sometimes we need to grant a computer rather than a user account access to SQL Server / database.

Unfortunately SQL Server Management Studio doesn't allow you to select a computer account when you create a new login.

Fear not as with most SQL related problems we can fix this via a SQL query which we can run from inside management studio.

EXEC master.dbo.sp_grantlogin @loginame = N'DOMAINNAME\COMPUTERNAME$'

Obviously replace DOMAINNAME with the name of your domain and COMPUTERNAME with the computer name.




No comments:

Post a Comment