How to grant IMPERSONATE permissions

In order to execute queries under a different security context (such as another login) using the EXECUTE AS clause, you must be able to impersonate the user.

To grant impersonate permissions on a specific login, run the query below.

USE [master];

GRANT IMPERSONATE ON LOGIN::[Domain\Impersonatee] TO [Domain\Impersonator];

To test this works you can run the query below.

USE [master];

EXECUTE AS LOGIN = 'Domain\Impersonatee';

Leave a Reply

Your email address will not be published. Required fields are marked *