The Multifunctioning DBA:

Powershell Tips


August 17, 2012  12:00 PM

Powershell to Drop Procs

Posted by: Colin Smith
POSH, Powershell Tips, Scripting, Scripts, SQL Admin, SQL Administration, SQL Administration. MS SQL, SQL Server

I was asked by a developer if I could drop all the procs in a database except the ones that he knew were being used. I thought Powershell can do that. So I told him that I could if he provided me a list of the ones that he did not want to be droped. So he sent me a list and I got to work. I thought...

August 27, 2009  3:13 PM

Questions about health check script

Posted by: Colin Smith
Answers, MS SQL, MS SQL Server, MSSQL Administration, Powershell, Powershell Tips, SQL Server

I recieved a comment that contained a question about my previous post about writing a script to output a health check of SQL Server. The following is the question: should we make anychanges for this do...

August 18, 2009  6:00 PM

Powershell Profile

Posted by: Colin Smith
Administration, Automation, Powershell, Powershell Tips, Scripting

The Powershell Profile is a script that druns anytime you launch Powershell. This is handy so you can ste up variables, add snapins, or just do what ever you like or think is cool when launching Powershell. I was just editing mine, which you can do by: notepad $profile This will pull up your...

August 18, 2009  5:47 PM

Find how many files of any extension are in a folder

Posted by: Colin Smith
One Liners, Powershell, Powershell Tips, Scripting, System Administration

Recently I needed to find out if I had any files of a certain extension in a particular folder and if so how many. With Powershell this is no problem at all. Say I was looking for a count of .ps1 files in the directory.


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: