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


Get-DbaXEventSessionTarget

Retrieves a list of Extended Events Session Targets.

Screenshots

dbatools-Get-DbaXEventSessionTarget

Examples

Shows targets for the system_health session on ServerA\sql987.

Get-DbaXEventSessionTarget -SqlInstance ServerA\sql987 -Session system_health

Returns the targets for the system_health session on sql2016.

Get-DbaXEventSession -SqlInstance sql2016 -Session system_health | Get-DbaXEventSessionTarget

Return only the package0.event_file target for the system_health session on sql2016.

Get-DbaXEventSession -SqlInstance sql2016 -Session system_health | Get-DbaXEventSessionTarget -Target package0.event_file

Author

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

Get-Help

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

Source Code

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

Related commands