I need to determine when, and by whom, a SQL Server was shutdown using the osql
command. The osql
command takes user name and password input. Are there any specific Windows Event logs generated to identify the user, time etc.?
Sql-server – Audit OSQL command shutting down a SQL Server
auditshutdownsql server
Related Question
- Sql-server – How todentify Who or What is Restarting SQL services via Service Control
- Sql-server – Can SQL Server Audit be used to track hostnames or IP adresses of the users performing DML on a table
- SQL Server – How to Create a User with SQL Server Authentication
- Sql-server – New SQL Server 2016 install — confused logging on via the command line
- Mysql – How do we identify service shutdown time in MySQL
Best Answer
As mentioned by Dan Guzman if you are using the T-SQL
SHUTDOWN
command to shut down SQL Server, you see see the details with username in two places:SQL Server Error Log
Windows Event Log
If you are stopping SQL Server from configuration manager, services in the control panel or command prompt, you will only get the stop time but not the user who initiated the stop command.