Copy-DbaXESession View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Copies Extended Event sessions from one SQL Server instance to another, excluding system sessions.
Description Copies custom Extended Event sessions between SQL Server instances while preserving their configuration and running state. This function scripts out the session definitions from the source server and recreates them on the destination, making it essential for server migrations, standardizing monitoring across environments, or setting up disaster recovery instances.
Copy-DbaXESessionTemplate View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Copies Extended Event session templates from dbatools repository to SSMS template directory for GUI access.
Description Installs curated Extended Event session templates into SQL Server Management Studio’s template directory so you can access them through the SSMS GUI.
The templates include common monitoring scenarios like deadlock detection, query performance tracking, connection monitoring, and database health checks.
Only copies non-Microsoft templates, preserving any custom templates already in your SSMS directory while adding the community-contributed ones from the dbatools collection.
Export-DbaXESession View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Generates T-SQL creation scripts for Extended Events sessions to files or console
Description Generates T-SQL scripts that can recreate your Extended Events sessions, making it easy to migrate monitoring configurations between environments or create backups of your XE session definitions. This is particularly useful when moving sessions from development to production, creating deployment scripts, or documenting your current monitoring setup for compliance purposes.
Export-DbaXESessionTemplate View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Exports Extended Events sessions as reusable XML templates for SSMS
Description Converts existing Extended Events sessions into XML template files that can be imported and reused in SQL Server Management Studio.
This lets you standardize XE session configurations across multiple environments without manually recreating session definitions.
Templates are saved to the SSMS XEvent templates folder by default, making them immediately available in the SSMS template browser.
Get-DbaXEObject View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS 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.
Get-DbaXESession View Source Klaas Vandenberghe (@PowerDBAKlaas) Windows, Linux, macOS Synopsis Retrieves Extended Events sessions with detailed configuration and status information from SQL Server instances.
Description This function connects to one or more SQL Server instances and returns comprehensive information about Extended Events sessions, including their current status, configuration details, target files, and memory settings. Extended Events sessions are SQL Server’s modern event-handling system used for performance monitoring, troubleshooting, and auditing.
Get-DbaXESessionTarget View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Retrieves Extended Events session targets with their configurations and file locations.
Description Returns detailed information about Extended Events session targets including their properties, file paths, and current status. This function helps DBAs examine where Extended Events data is being captured, whether sessions are running or stopped, and provides both local and UNC file paths for easy access to target files.
Get-DbaXESessionTargetFile View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Retrieves physical Extended Events target files from the file system for analysis and troubleshooting.
Description Returns file system objects for Extended Events session target files, allowing you to examine the actual XE log files created by file-based targets. This function locates and lists the physical .xel files generated by Extended Events sessions, making it easy to access them for analysis with tools like SQL Server Management Studio or third-party XE file readers.
Get-DbaXESessionTemplate View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Retrieves metadata from Extended Event session templates to help you discover and select pre-built monitoring solutions.
Description Retrieves metadata from Extended Event session templates stored in XML format, showing you what pre-built Extended Event sessions are available before importing them to your SQL Server instances. This saves you from manually browsing template files or guessing what monitoring solutions exist for specific scenarios.
Get-DbaXEStore View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Retrieves the Extended Events store object for managing XEvent sessions and configurations
Description Retrieves the Extended Events store object from SQL Server instances, which serves as the foundation for working with Extended Events sessions, packages, and configurations. The store object provides access to session management, event package information, and running session counts. This is typically the first step when building Extended Events monitoring solutions or auditing XEvent configurations across your environment.