Any ideas on how to issue an alter login command from a stored proc to change the password to a default? I believe that I need to run the command with an execute as securityadmin login but it doesn't seem to work.
when i try to run it I get an error of
"Cannot execute as the server principal because the principal "ADMIN_USER" does not exist, this type of principal cannot be impersonated, or you do not have permission."
I have used the execute as command in the proc and am running as a securityadmin login.
I won't be able to pass in the old password and I am running the following command
ALTER LOGIN testlogin WITH PASSWORD = 'testlogin_123' MUST_CHANGE ,CHECK_POLICY = ON , CHECK_EXPIRATION = ON