---
title: "Get-DbaInstanceProperty"
description: "Retrieves comprehensive SQL Server instance configuration properties for auditing and comparison"
url: "https://dbatools.io/Get-DbaInstanceProperty/"
availability: "Windows, Linux, macOS"
tags: ["Instance", "Configure", "Configuration", "General"]
author: "Klaas Vandenberghe (@powerdbaklaas)"
source: "https://github.com/dataplat/dbatools/blob/master/public/Get-DbaInstanceProperty.ps1"
last_updated: "2024-01-01"
---

# Get-DbaInstanceProperty

## Synopsis

Retrieves comprehensive SQL Server instance configuration properties for auditing and comparison

## Description

Retrieves all instance-level configuration properties from SQL Server's Information, UserOptions, and Settings collections via SMO. This gives you a complete inventory of server settings like default file paths, memory configuration, security options, and user defaults in a standardized format. Essential for configuration audits, compliance reporting, environment comparisons, and troubleshooting configuration-related issues across multiple instances.

## Syntax

```powershell
Get-DbaInstanceProperty
    [-SqlInstance] <DbaInstanceParameter[]>
    [[-SqlCredential] <PSCredential>]
    [[-InstanceProperty] <Object[]>]
    [[-ExcludeInstanceProperty] <Object[]>]
    [-EnableException]
    [<CommonParameters>]

```

## Examples

### Example 1: Returns SQL Server instance properties on the local default SQL Server instance

```powershell
PS C:\> Get-DbaInstanceProperty -SqlInstance localhost
```

### Example 2: Returns SQL Server instance properties on default instance on sql2 and sqlexpress instance on sql4

```powershell
PS C:\> Get-DbaInstanceProperty -SqlInstance sql2, sql4\sqlexpress
```

### Example 3: Returns SQL Server instance properties on sql2 and sql4

```powershell
PS C:\> 'sql2','sql4' | Get-DbaInstanceProperty
```

### Example 4: Returns SQL Server instance property DefaultFile on instance sql2 and sql4

```powershell
PS C:\> Get-DbaInstanceProperty -SqlInstance sql2,sql4 -InstanceProperty DefaultFile
```

### Example 5: Returns all SQL Server instance properties except DefaultFile on instance sql2 and sql4

```powershell
PS C:\> Get-DbaInstanceProperty -SqlInstance sql2,sql4 -ExcludeInstanceProperty DefaultFile
```

### Example 6: Connects using sqladmin credential and returns SQL Server instance properties from sql2

```powershell
PS C:\> $cred = Get-Credential sqladmin
PS C:\> Get-DbaInstanceProperty -SqlInstance sql2 -SqlCredential $cred
```

### Required Parameters

##### -SqlInstance

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.

| Property | Value |
| --- | --- |
| Alias |  |
| Required | True |
| Pipeline | true (ByValue) |
| Default Value |  |

### Optional Parameters

##### -SqlCredential

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.

| Property | Value |
| --- | --- |
| Alias |  |
| Required | False |
| Pipeline | false |
| Default Value |  |

##### -InstanceProperty

Specifies which SQL Server instance properties to include from Information, UserOptions, and Settings collections. Accepts wildcards and arrays.  
Use this to focus on specific configuration properties like DefaultFile, MaxWorkerThreads, or LoginMode when auditing particular settings across instances.

| Property | Value |
| --- | --- |
| Alias |  |
| Required | False |
| Pipeline | false |
| Default Value |  |

##### -ExcludeInstanceProperty

Specifies which SQL Server instance properties to exclude from the results. Accepts wildcards and arrays.  
Use this to filter out noisy or irrelevant properties when you need a cleaner view of configuration data for reporting or comparison.

| Property | Value |
| --- | --- |
| Alias |  |
| Required | False |
| Pipeline | false |
| Default Value |  |

##### -EnableException

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.

| Property | Value |
| --- | --- |
| Alias |  |
| Required | False |
| Pipeline | false |
| Default Value | False |

## Outputs

**PSCustomObject**

Returns one object per instance property from the Information, UserOptions, and Settings collections. The function returns properties from three separate SMO collections, outputting each property with contextual information about which collection it came from.

**Default display properties (via Select-DefaultView):**

- ComputerName: The name of the computer hosting the SQL Server instance
- InstanceName: The SQL Server instance name
- SqlInstance: The full SQL Server instance name (computer\instance format)
- Name: The property name (e.g., DefaultFile, MaxWorkerThreads, LoginMode, TcpPort)
- Value: The current value of the configuration property (string or mixed type depending on property)
- PropertyType: The type of property collection - either "Information", "UserOption", or "Setting"
The -InstanceProperty and -ExcludeInstanceProperty parameters filter which specific properties are returned but do not change the output structure.

---

Part of [dbatools](https://dbatools.io/), a free and open source PowerShell module for SQL Server administration. Full command index: https://dbatools.io/commands/
