dbatools is a free PowerShell module with over 200 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-DbaXEventsSession

Retrieves a list of Extended Events Sessions.

Screenshots

Examples

To return a custom object with ComputerName, SQLInstance, Extended Event Session, StartTime, Status and other properties.

Get-DbaXEventsSession -SqlServer ServerA\sql987

To return a formatted table displaying ComputerName, SQLInstance, Extended Event Session, and Status.

Get-DbaXEventsSession -SqlServer ServerA\sql987 | Format-Table ComputerName, SQLInstance, Session, Status -AutoSize

To return a custom object with ComputerName, SQLInstance, Extended Event Session, StartTime, Status and other properties, from multiple SQL Instances.

‘ServerA\sql987′,’ServerB’ | Get-DbaXEventsSession

Author

This command was created by Klaas Vandenberghe. You can find Klaas on Twitter and his blog.

Get-Help

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

Source Code

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

Related commands