{"id":77441,"date":"2016-02-27T11:59:14","date_gmt":"2016-02-27T19:59:14","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/?p=77441"},"modified":"2019-02-18T09:19:44","modified_gmt":"2019-02-18T16:19:44","slug":"powertip-enable-and-disable-odbc-performance-counter-settings-with-powershell","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-enable-and-disable-odbc-performance-counter-settings-with-powershell\/","title":{"rendered":"PowerTip: Enable and disable ODBC performance counter settings with PowerShell"},"content":{"rendered":"<p><strong>Summary<\/strong>: Learn how to enable and disable a collection of ODBC performance counter settings for troubleshooting.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/>\u00a0How can I use Windows PowerShell to enable the ODBC performance counters, run commands in a script, and then disable the counters?<\/p>\n<p style=\"padding-left: 30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/>\u00a0You can store a returned object for later use when you enable the performance counters by using the <strong>-PassThru<\/strong> parameter, for example:<\/p>\n<p style=\"padding-left: 90px\">$perfCounter = Enable-OdbcPerfCounter -Platform 32-bit -PassThru\n&lt;Execute some ODBC applications that are using ODBC pooling&gt;\nDisable-OdbcPerfCounter $perfCounter<\/p>\n<p style=\"padding-left: 30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7610.Dr.ScriptoForTips.jpg\" alt=\" \" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Learn how to enable and disable a collection of ODBC performance counter settings for troubleshooting. \u00a0How can I use Windows PowerShell to enable the ODBC performance counters, run commands in a script, and then disable the counters? \u00a0You can store a returned object for later use when you enable the performance counters by using [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[639],"tags":[669,60,356,3,45],"class_list":["post-77441","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powertip","tag-odbc","tag-performance","tag-powertip","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Learn how to enable and disable a collection of ODBC performance counter settings for troubleshooting. \u00a0How can I use Windows PowerShell to enable the ODBC performance counters, run commands in a script, and then disable the counters? \u00a0You can store a returned object for later use when you enable the performance counters by using [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/77441","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=77441"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/77441\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=77441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=77441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=77441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}