1

I'm working on building some documentation across my systems and planned on simply using Powershell to script out the legwork of what I wanted to do. While that's going all well and good, I ran into an issue with my SQL Server registry entries. The problem being that some of my SQL servers have all of their registry values while some don't.

For example, I'm pulling down the SQL Shared Features entry so I know where that directory is on all servers. Now some of them are pulling data back (E:\yada\yada) while others aren't pulling anything back. After further investigation, I have noticed that several of my SQL servers don't have the required registration data saved within the registry. This happens with several different registry entries that should be there.

Any reason it's like this?

2 Answers 2

1

Instead of reinventing the wheel (there is a cost associated to it), use SQL PowerDoc written by kendalvandyke. Its a powershell based solution.

Documentation can be found here.

I have noticed that several of my SQL servers don't have the required registration data saved within the registry.

SQL server will have everything in the registry settings. For shared Features, I believe the registry is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-518\Components\0D1F366D0FE0E404F8C15EE4F1C15094

Refer to File Locations for Default and Named Instances of SQL Server

1

Registry keys can change with all software products between major versions or even with a service pack. Instead of trying to pull the values from searching the registry you might consider just using SMO.

For instance to find the directory path you are looking for simply use the following:


[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO')
$s = new-object microsoft.sqlserver.management.smo.server MyServer
$s.InstalSharedDirectory

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.