03 October,2014 by Tom Collins
Question: I’m experiencing an execute error when running a script through xp_cmdshell? I think the issue is related to my Windows permissions on the OS. How can I view the Windows account used when I execute xp_cmdshell?
Answer: This is a common problem. When executing xp_cmdshell through SQL Server – the security context is the SQL Server start up account.
Use the command "xp_cmdsell whoami" to view the account used.
Note: Treat xp_cmdshell with caution . Read Xp_cmdshell – the most dangerous extended stored procedure on the planet
SQL Server – Restrict SQL Server Logons by IP with EVENTDATA and SQL Logon Trigger
How to create a SQL Server Security Audit
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |