I got this question on twitter recently so I decided to blog it real quick. The question is, how do you output data to excel from powershell? Well, there’s a free function that I’ve used and I’ve been quite happy with it. I’m not going to give a lot of explanation here except to say … Continue reading Powershell to Excel→
We have here an easy, handy-dandy way to find out how much CPU is in use on your server. Of course you can find out by opening up task manager, or by running perfmon, but that’s not really the point. We want something quick and easy. We want something we could potentially use for monitoring, … Continue reading What’s the CPU usage on the server? Use #Powershell!!→
Ok, here’s the situation. You need to format an array of values for use in a SQL query. You want the final output to look something like this: SELECT * from dbo.T1 where col1 IN (1, 15, 17, 23, 55, 67, 88) The elements in the IN clause are what you got from the array. … Continue reading Powershell: Format array elements for SQL queries→
I was helping someone out with something so I thought you guys would like to have these 2 short lines of code that can be pretty useful. Here I’m going to show you how to check your DB for tables that have triggers, and then for tables with no indexes. Do with them what you … Continue reading Finding Triggers in Powershell→
One of the biggest battles I fight when I teach PS or show it to different companies is adoption. DBAs and managers just don’t get why they should be using PS to manage their environments. And the reason so many of them are slow to adopt is because the right message is very hard to … Continue reading Why is adopting Powershell so hard?→
Ok, well I’ve been very busy again and released 3 new PS vids today. There’s one on dropping tables. I use regex to make this happen, so even if you’re not interested in dropping tables, you can come learn how to do a simple regex. http://midnightdba.itbookworm.com/VidPages/PowershellDropTables/PowershellDropTables.aspx http://midnightdba.itbookworm.com/VidPages/PowershellDropTables/PowershellDropTables.wmv The next one is on truncating tables. … Continue reading Powershell till you drop→
Here’s another vid. This one is on working with detach in PS. http://midnightdba.itbookworm.com/VidPages/PowershellDetachMethods/PowershellDetachMethods.aspx
Hey guys, I posted a new video last night on how to get IP and DNS info from your servers. I know there are more ways to do it so if you guys have a way you like better send it to me and I’ll make another vid. http://midnightdba.itbookworm.com/VidPages/PowershellGetIPandDNS/PowershellGetIPandDNS.aspxhttp://midnightdba.itbookworm.com/VidPages/PowershellGetIPandDNS/PowershellGetIPandDNS.aspx
I’ve been a busy little guy this week. I’ve posted 4 new videos. The first one is on cycling the SQL error log from Powershell. Well, not really, you’re really deploying the solution to other boxes using Powershell. You can see it here: http://midnightdba.itbookworm.com/VidPages/PowershellCycleErrorLog/PowershellCycleErrorLog.aspx The next one is about reading the SQL error log from Powershell. You … Continue reading Hey, how about some new Powershell vids?→
I read a blog today from my good friend @SirSQL (Nic Cain) where he was talking about how to change retry attempts on all the jobs on a server. Well, technically it’s the job steps that have the retry attempts, not the jobs themselves. And whenever I see something like this, my fabulously huge MCM … Continue reading Changing Job Step Properties in Powershell→