SQL Server startup parameters -d, -l, -e which store the information about the master database data file, log file and ERRORLOG locations respectively are stored under the registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.X\MSSQLServer\Parameters
However, if you need to find out the startup parameters without using the regedit snap-in (default and any extra ones added), you can use the following script:
<<SCRIPT>>
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\Microsoft\SqlServer\ComputerManagement")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM SqlServiceAdvancedProperty WHERE SqlServiceType = 1 and PropertyName = 'STARTUPPARAMETERS'",,48)
For Each objItem in colItems
Wscript.Echo "ServiceName: " & objItem.ServiceName
Wscript.Echo "PropertyName: " & objItem.PropertyName
Wscript.Echo "PropertyStrValue: " & objItem.PropertyStrValue
Next
<</SCRIPT>
Comments
3 responses to “How to find startup parameters for SQL Server 2005 using WMI”
[…] your co-worker , then you can use a VBScript (or Powershell) to fetch this information. Here is an example for obtaining the Startup Parameters using WMI and […]
LikeLike
[…] Tab. Alternatively, you can use a VBScript (or Powershell) to fetch this information. Here is an example for obtaining the Startup Parameters using WMI and […]
LikeLike
[…] instance of SQL Server with the binaries and system database files on the C: drive. I had earlier blogged about how to find out the startup parameters using a WMI class and VBScript. I just use PowerShell […]
LikeLike