r/SQLServer • • May 15 '26

Question How do you collect SQL Server instance configuration that SMO doesn't expose?

Hello I'm trying to update our tool that documents SQL configuration and found we have a gap in the documentation for on-premises SQL Server around the Encryption, CEIP, network protocols, startup parameters, error loggin etc. This information is in SQL Server Configuration Manager but a lot of this information isn't exposed through SQL queries or SMO (well sometimes it is, but then it uses WMI).

How do you gather this information in real life? The registry functionality in SQL queries looks either limited or risky.

I was going to do it using two methods - SMO for most information and then use PowerShell remoting with a WMI fallback to gather host information (manufacturer, model, etc) and also the SQL Server Configuration Manager information.

Or am I missing an easier way?

Thanks, Dave

8 Upvotes

19 comments sorted by

View all comments

Show parent comment

2

u/Afraid_Baseball_3962 May 15 '26

As a DBA, I'd never suggest to use undocumented/unsupported functionality in application code that the business depends on. At the same time, I use it myself for administration and documentation. It's an important distinction. I suspect that most other DBAs would agree.

2

u/Few_Committee_6790 May 15 '26

If it is for my own use or my teams use knowing that it is undocumented or might change without notice. We use them. Never ever in code that a customer would use and when I say customer. That includes if the application doesn't reach the general public your corporate users

2

u/imtheorangeycenter May 15 '26

It's a tool for me, not for thee. I'm also allowed to bend the rules and best practices I yap on at you about.

1

u/DavidHomerCENTREL May 15 '26

OK good, sounds like what I was thinking. PowerShell/WMI fallback is the right way.