---
title: "Get-DbaXEObject"
description: "Retrieves Extended Events objects available for monitoring and troubleshooting on SQL Server instances."
url: "https://dbatools.io/Get-DbaXEObject/"
availability: "Windows, Linux, macOS"
tags: ["ExtendedEvent", "XE", "XEvent"]
author: "Chrissy LeMaire (@cl), netnerds.net"
source: "https://github.com/dataplat/dbatools/blob/master/public/Get-DbaXEObject.ps1"
last_updated: "2024-01-01"
---

# Get-DbaXEObject

## Synopsis

Retrieves Extended Events objects available for monitoring and troubleshooting on SQL Server instances.

## Description

This function queries sys.dm_xe_packages and sys.dm_xe_objects to discover what Extended Events components are available on your SQL Server instances. Use this when planning Extended Events sessions to see what events you can capture, what actions you can attach, and what targets you can write to. Essential for DBAs setting up performance monitoring, security auditing, or troubleshooting sessions since XE object availability varies by SQL Server version and edition.

## Syntax

```powershell
Get-DbaXEObject
    [-SqlInstance] <DbaInstanceParameter[]>
    [[-SqlCredential] <PSCredential>]
    [[-Type] <String[]>]
    [-EnableException]
    [<CommonParameters>]

```

## Examples

### Example 1: Lists all the XE Objects on the sql2016 SQL Server

```powershell
PS C:\> Get-DbaXEObject -SqlInstance sql2016
```

### Example 2: Lists all the XE Objects of type Action and Event on the sql2017 SQL Server

```powershell
PS C:\> Get-DbaXEObject -SqlInstance sql2017 -Type Action, Event
```

### Required Parameters

##### -SqlInstance

The target SQL Server instance or instances. You must have sysadmin access and server version must be SQL Server version 2008 or higher.

| 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 |  |

##### -Type

Filters the Extended Events objects by specific component types to help you find the XE building blocks you need.  
Use this when planning XE sessions to focus on specific components rather than viewing all available objects.  
Events capture SQL Server activities, Actions attach additional data to events, Targets define where to store captured data, and Predicates filter which events to capture.

| Property | Value |
| --- | --- |
| Alias |  |
| Required | False |
| Pipeline | false |
| Default Value |  |
| Accepted Values | Type,Event,Target,Action,Map,Message,PredicateComparator,PredicateSource |

##### -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 Extended Events component available on the SQL Server instance. The number of objects returned depends on the SQL Server version and installed components.

**Default display properties (excludes ComputerName, InstanceName, ObjectTypeRaw):**

- PackageName: Name of the Extended Events package (e.g., 'package0', 'sqlserver')
- ObjectType: Type of XE object (Event, Action, Target, Map, Message, Type, PredicateComparator, PredicateSource)
- TargetName: Name of the Extended Events object
- Description: Description of what the XE object does

**All properties available when using Select-Object *:**

- ComputerName: The computer name hosting the SQL Server instance
- InstanceName: The SQL Server instance name
- SqlInstance: Full SQL Server instance name (computer\instance format)
- PackageName: Name of the Extended Events package
- ObjectType: Friendly-formatted object type
- ObjectTypeRaw: Raw database value ('type', 'event', 'target', 'pred_compare', 'pred_source', 'action', 'map', 'message')
- TargetName: Name of the Extended Events object
- Description: Description of the XE object
Use the -Type parameter to filter results to specific component types without changing 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/
