February 27th, 2016

PowerTip: Enable and disable ODBC performance counter settings with PowerShell

Doctor Scripto
Scripter

Summary: Learn how to enable and disable a collection of ODBC performance counter settings for troubleshooting.

Hey, Scripting Guy! Question How can I use Windows PowerShell to enable the ODBC performance counters, run commands in a script, and then disable the counters?

Hey, Scripting Guy! Answer You can store a returned object for later use when you enable the performance counters by using the -PassThru parameter, for example:

$perfCounter = Enable-OdbcPerfCounter -Platform 32-bit -PassThru <Execute some ODBC applications that are using ODBC pooling> Disable-OdbcPerfCounter $perfCounter

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.