dbatools is a free PowerShell module with over 300 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


This function returns a list of Traces on a SQL Server Instance and identify the default Trace File.




Lists all the XE Objects on the sql2016 SQL Server.

Get-DbaXEObject -SqlInstance sql2016

Lists all the XE Objects of type action and event on the sql2017 SQL Server.

Get-DbaXEObject -SqlInstance sql2017 -Type Action, Event


This command was created by Chrissy LeMaire. You can find Chrissy on Twitter.


From PowerShell, execute Get-Help Get-DbaXEObject -Detailed for more information on this function.

Source Code

Want to see the source code? View Get-DbaXEObject.ps1 on GitHub

Related commands