| Abilitazioni xp_cmdshell SQL server 2000 |
|
|
|
|
How to enable non-sysadmin accounts to execute the "xp_cmdshell" extended stored procedure in SQL Server 2000 Per farla breve: Method 2: Run a Transact-SQL scriptRun the following Transact-SQL script to enable the Windows account to execute the xp_cmdshell extended stored procedure:
-- Set database to master. USE master GO -- Add a valid Windows account as proxy account. EXECUTE xp_sqlagent_proxy_account N'SET' , N'<DomainName>' , N'<WindowsAccount>' , N'<WindowsPassword>' GO -- Get the proxy account to determine whether it is set up correctly. EXECUTE xp_sqlagent_proxy_account N'GET' GO -- Enable non-system administrators to run the job and to execute xp_cmdshell. EXECUTE msdb..sp_set_sqlagent_properties @sysadmin_only = 0 GO To add the SQL Server login account that you want to grant permission to execute the xp_cmdshell extended stored procedure, run the following Transact-SQL script:
USE master GO -- Grant database access to the SQL Server login account that you want to provide access. EXEC sp_grantdbaccess '<SQLLogin>' GO -- Grant execute permission on xp_cmdshell to the SQL Server login account. GRANT exec ON xp_cmdshell TO <SQLLogin> GO Note The proxy account is the Windows account in whose security context the SQL Server Agent jobs or command-line commands are run. When you set up the Windows account for the SQL Server Agent proxy account, you must give the account the Windows-level "Log on as a batch job" user right.
oppure tutto l'articolo
|
| < Prec. | Pros. > |
|---|


