Author | Klaas Vandenberghe (@powerdbaklaas) |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Get-DbaInstanceProperty on GitHub.
Want to see the Bill Of Health for this command? Check out Get-DbaInstanceProperty.
Gets SQL Server instance properties of one or more instance(s) of SQL Server.
The Get-DbaInstanceProperty command gets SQL Server instance properties from the SMO object sqlserver.
Get-DbaInstanceProperty
[-SqlInstance] <DbaInstanceParameter[]>
[[-SqlCredential] <PSCredential>]
[[-InstanceProperty] <Object[]>]
[[-ExcludeInstanceProperty] <Object[]>]
[-EnableException]
[<CommonParameters>]
PS C:\> Get-DbaInstanceProperty -SqlInstance localhost
Returns SQL Server instance properties on the local default SQL Server instance
PS C:\> Get-DbaInstanceProperty -SqlInstance sql2, sql4\sqlexpress
Returns SQL Server instance properties on default instance on sql2 and sqlexpress instance on sql4
PS C:\> 'sql2','sql4' | Get-DbaInstanceProperty
Returns SQL Server instance properties on sql2 and sql4
PS C:\> Get-DbaInstanceProperty -SqlInstance sql2,sql4 -InstanceProperty DefaultFile
Returns SQL Server instance property DefaultFile on instance sql2 and sql4
PS C:\> Get-DbaInstanceProperty -SqlInstance sql2,sql4 -ExcludeInstanceProperty DefaultFile
Returns all SQL Server instance properties except DefaultFile on instance sql2 and sql4
PS C:\> $cred = Get-Credential sqladmin
PS C:\> Get-DbaInstanceProperty -SqlInstance sql2 -SqlCredential $cred
Connects using sqladmin credential and returns SQL Server instance properties from sql2
The target SQL Server instance or instances. This can be a collection and receive pipeline input to allow the function to be executed against multiple SQL Server instances.
Alias | |
Required | True |
Pipeline | true (ByValue) |
Default Value |
Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).
Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported.
For MFA support, please use Connect-DbaInstance.
Alias | |
Required | False |
Pipeline | false |
Default Value |
SQL Server instance property(ies) to include.
Alias | |
Required | False |
Pipeline | false |
Default Value |
SQL Server instance property(ies) to exclude.
Alias | |
Required | False |
Pipeline | false |
Default Value |
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |