How to find startup parameters for SQL Server 2005 using WMI


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>

Advertisements

3 thoughts on “How to find startup parameters for SQL Server 2005 using WMI

  1. Pingback: Wiki: SQL Database Engine Startup Failures « TroubleshootingSQL

  2. Pingback: Wiki: SQL Database Engine Startup Failures for Clusters « TroubleshootingSQL

  3. Pingback: Azure Storage and SQL Server – Part 7 | TroubleshootingSQL

It is always good to hear from you! :)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s