Posted in
Windows Powershell |
No Comment | 1,016 views | 22/02/2016 11:02
You can get detailed SQL Server properties via following code:
1
2
3
4
5
6
7
8
9
10
11
12
13
| $MSSQLServerManager = New-Object 'Microsoft.SqlServer.Management.SMO.Server'
$HostSQLAuditLevel = $MSSQLServerManager.AuditLevel;
$HostSQLBuildClrVersionString = $MSSQLServerManager.BuildClrVersionString;
$HostSQLIsCaseSensitive = $MSSQLServerManager.IsCaseSensitive;
$HostSQLIsClustered = $MSSQLServerManager.IsClustered;
$HostSQLIsFullTextInstalled = $MSSQLServerManager.IsFullTextInstalled;
$HostSQLIsHadrEnabled = $MSSQLServerManager.IsHadrEnabled;
$HostSQLIsSingleUser = $MSSQLServerManager.IsSingleUser;
$HostSQLIsXTPSupported = $MSSQLServerManager.IsXTPSupported;
$HostSQLTcpEnabled = $MSSQLServerManager.TcpEnabled;
$HostSQLDefaultTextMode = $MSSQLServerManager.DefaultTextMode;
$HostSQLMaxPrecision = $MSSQLServerManager.MaxPrecision;
$HostSQLNamedPipesEnabled = $MSSQLServerManager.NamedPipesEnabled; |
$MSSQLServerManager = New-Object 'Microsoft.SqlServer.Management.SMO.Server'
$HostSQLAuditLevel = $MSSQLServerManager.AuditLevel;
$HostSQLBuildClrVersionString = $MSSQLServerManager.BuildClrVersionString;
$HostSQLIsCaseSensitive = $MSSQLServerManager.IsCaseSensitive;
$HostSQLIsClustered = $MSSQLServerManager.IsClustered;
$HostSQLIsFullTextInstalled = $MSSQLServerManager.IsFullTextInstalled;
$HostSQLIsHadrEnabled = $MSSQLServerManager.IsHadrEnabled;
$HostSQLIsSingleUser = $MSSQLServerManager.IsSingleUser;
$HostSQLIsXTPSupported = $MSSQLServerManager.IsXTPSupported;
$HostSQLTcpEnabled = $MSSQLServerManager.TcpEnabled;
$HostSQLDefaultTextMode = $MSSQLServerManager.DefaultTextMode;
$HostSQLMaxPrecision = $MSSQLServerManager.MaxPrecision;
$HostSQLNamedPipesEnabled = $MSSQLServerManager.NamedPipesEnabled;
You can also check other properties by listing all properties of $MSSQLServerManager.