search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Getting MSSQL Server Properties with PowerShell
Posted in Windows Powershell | No Comment | 730 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;

You can also check other properties by listing all properties of $MSSQLServerManager.



Leave a Reply