The Multifunctioning DBA:


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...

January 15, 2012  8:00 AM

Connect-sql Function

Posted by: Colin Smith
Powershell, Scripting, SMO

This is a function that I keep in my profile so I can call it in any of my scripts that will run from my profile. It makes it easier for me so it might for you. function connect-sql ($arg) { if($arg -eq $null) { $server = Read-Host "enter instance name to connect to" } else { $server =...

June 1, 2011  7:49 PM

Great Powershell Article

Posted by: Colin Smith
IT Pros, Powershell, Scripting

I found this article today and I thought I should mention it and then post a bit about some of the comments that I see. So go check out the article at and also read the...

January 29, 2011  8:00 AM

Powershell Formatting

Posted by: Colin Smith
Formatting, Powershell, Scripting, Training, Webcast

I did not get to see this during the live presentation but I am looking forward to seeing it especially after hearing some co-workers talk about it. If you have the time check it out. I am sure it is going to be great.

November 24, 2010  6:52 PM

Find Database Files with Powershell

Posted by: Colin Smith
Add new tag, DBA, Powershell, Scripting

I recently had a request to go out and find the logical name and the physical name of mdf and ldf files in sql server. I thought this might be a good place to use powershell and the invoke-sqlcmd cmd-let that is with sqlserver2008 snapin. Here is an example of what I did to find the files for...

November 23, 2010  7:05 PM

Powershell Find Files modified after a date

Posted by: Colin Smith
Filesystem, Managment, Powershell, Scripting

I recently needed to find all files in a specific directory that had been written to after a specific date. I also wanted to include all subfolders in the search. I decided to use Powershell to do this and man was it simple. First you have to define the date that you are looking for and you have to...

October 28, 2010  11:00 PM

SQL Server Monitoring

Posted by: Colin Smith
Database Monitoring, Monitoring, Powershell, Scripting

I am getting back into writing my monitoring application in powershell and I have made some progress over the last few days. I have figured out my issue with getting the backup dates and times inserted into my monitoring database and also not entering the information multiple times if I already...

October 28, 2010  9:58 PM

Powershell change color of text

Posted by: Colin Smith
Formatting, Powershell, Scripting

I am working on a script that accepts some user inputs and then echos that back to the user for validation. For this I wanted to make the text that the user submitted be in RED so that it would stand out and make it more readable. I was looking for a way to use this doing echo and echo is an...

October 5, 2010  9:47 PM

Exchange Email Changes (filtering)

Posted by: Colin Smith
Exchange Scripting, Powershell, Scripting

Sorry for the long delay in posts but I have been moving and it is a mess. We purchased a prevously owned home and I will never do that again. New is the only way to go. But now that we are settling in and things are starting to wind down I love the house. Still a ton to do though. Anyway back...

August 30, 2010  10:00 AM

Exchange Email Changes (Users meet Mialboxes)

Posted by: Colin Smith
Exchange Scripting, Powershell, Scripting

Now that I have both the users stored in an array and the mailboxes stored in another array it is time to start making sure that I am working with a mailbox and a user account that match up. I do not want to look at my user account and Johns Mailbox and start making changes based on what I find in...

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: