Checking enabled features
SQL has many features. We can find out if certain features are enabled by using SMO and PowerShell. To determine this, you need to access the object that owns that feature. For example, some features are available to be queried once you create an SMO server object:
Import-Module SQLPS -DisableNameChecking #current server name $servername = "ROGUE" $server = New-Object "Microsoft.SqlServer.Management.Smo.Server" $servername $server | Select-Object IsClustered, ClusterName, FilestreamLevel, IsFullTextInstalled, LinkedServers, IsHadrEnabled, AvailabilityGroups
In the preceding script, we can easily find out the following parameters:
- Is the server clustered (
IsClustered)? - Does it support
FileStreamand to what level (FilestreamLevel)? - Is
FullTextinstalled (IsFullTextInstalled)? - Are there any configured linked servers in the system (
LinkedServers)? - Is
AlwaysOnenabled (IsHadrEnabled) and are any availability groups configured (AvailabilityGroups...