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 FileStream and to what level (FilestreamLevel ...

Get PowerShell for SQL Server Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.