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


Start-DbaTrace

This command starts a trace on a SQL Server Instance.

Screenshots

dbatools-Start-DbaTrace

Examples

Starts all traces on sql2008.

Start-DbaTrace -SqlInstance sql2008

Starts all trace with ID 1 on sql2008.

Start-DbaTrace -SqlInstance sql2008 -Id 1

Starts selected traces on sql2008.

Get-DbaTrace -SqlInstance sql2008 | Out-GridView -PassThru | Start-DbaTrace

Author

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

Get-Help

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

Source Code

Want to see the source code? View Start-DbaTrace.ps1 on GitHub
 

Related commands