Tag Archives: Error

Setting the PowerShell Execution Policy

Problem
Recently I moved PowerShell script files to a production environment and when executing it from the command prompt, I got this error: “File cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details”. In this tip we cover what needs to be done to resolve this issue.

Solution
http://www.mssqltips.com/sqlservertip/2702/setting-the-powershell-execution-policy/

Msg 15063, Level 16, State 1

Error:
Msg 15063, Level 16, State 1, Server DBServerName, Line 1
The login already has an account under a different user name.

Cause
Login already has an account under a different user name on particular database.

User is executing sp_GrantDBAccess.  sp_GrantDBAccess system stored procedure adds a security account in the current database for a Microsoft SQL Server login or Microsoft Windows NT user or group, and enables it to be granted permissions to perform activities in the database.
But the login already has an account under a different user name on current database. That’s why the it is throwing an error.
 
Solution
Instead of using sp_GrantDBAccess user has to execute below query
ALTER AUTHORIZATION ON SCHEMA::[db_accessadmin] TO [GMO\service-ueagle]