Click here to monitor SSC

Author Profile

Laerte Junior

Laerte Junior is a Cloud and Datacenter Management MVP, focused on PowerShell and automation and, through through his technology blog and simple-talk articles, an an active member of the SQL Server and PowerShell community around the World. He is a skilled Principal Database Architect, Developer, and Administrator, specializing in SQL Server and PowerShell Programming and Automation. He also is PASS Virtual Chapter Mentor , Co-Lead of the PASS PowerShell Virtual Chapter and former PASS Regional Mentor for Brasil. In addition He is also a HUGE Star Wars Fan, his main skill. "May The Force be with us" You should follow him on Twitter as @LaerteSQLDBA

The PoSh DBA: Accessing SQL Server from PowerShell

The worst part for a DBA of getting started with PowerShell is often just figuring out the best way of working with SQL Server. The most suitable approach to accessing SQL Server depends on the sort of task you need to produce a script for. Laerte Junior aims at a simple guide to the most common approaches and when to use them. Read more...

Questions About PowerShell Basics That You Were Too Shy To Ask

Developers who are already familiar with application languages will be baffled by different aspects of PowerShell to the beginner to programming. Laerte recalls his initial struggles with PowerShell and answers those questions he wished he'd found quick answers to. Read more...

The PoSh DBA: Assigning Data to Variables Via PowerShell Common Parameters

Sometimes, it is the small improvements in a language that can make a real difference. PowerShell is able to introduce extra common parameters that can be used by any Cmdlet or advanced function. When -PipelineVariable was introduced in V4, we all wondered what it could be used for. Laerte experimented and discovered that it could be a real convenience in every-day scripting with the pipeline. Read more...

The PoSh DBA - Towards the Re-usable PowerShell Script

When starting out with PowerShell, it is hard to escape from the detail to work out the best strategy for creating scripts. Laerte explains how, when and why it pays to think in terms of versatile functions to meet varying demands. Read more...

The PoSh DBA - Using the Basic PowerShell Paradigms

PowerShell is like any computer language: you must understand the paradigms, the constructs, and the way it is designed to work to get the most value from it. It is no good just translating 'sausage-string' procedural algorithms. To demonstrate how PowerShell should be used as its' creators intended, Laerte Junior shows the difference between PowerShell problem-solving with, and without, PowerShell paradigms. Read more...

Automating Your SQL Server Best Practice Reports: The Document

If you're making a report from table-based data, an MS Word document is often a good option. In the second part of his introduction to SQL Server best-practice monitoring, Laerte Junior shows how to use PowerShell scripts to create a Word-based report with colour-coded alerts where there are problems or best practices aren't being followed. Read more...

Automating Your SQL Server Best Practice Reports:The Checks

A DBA in charge of a whole lot of databases and servers has to check regularly that there are no likelihood of problems. The task is well suited for automation as workload increases. Laerte Junior introduces a PowerShell-based reporting framework that aims to simply provide a Word-based report with colour-coded alerts where there are problems or best practices aren't being followed. Read more...

The PoSh DBA – Specifying and Gathering Performance Counters

If you are needing to keep tabs on a number of servers and applications in a Windows domain then performance counters provide the bedrock of information. It is important to identify the counters you need and gather baseline data to allow you to create alerts when abnormal conditions occur. When it comes to monitoring SQL Server, don't guess, collect. Read more...

The PoSh DBA - Reading and Filtering Errors

DBAs regularly need to keep an eye on the error logs of all their SQL Servers, and the event logs of the host servers as well. When server numbers get large, the traditional Windows GUI approach breaks down, and the PoSH DBA reaches for a PowerShell script to do the leg-work. Read more...

The PoSH DBA - SQLPSX: SQL Server PowerShell Extensions

Every DBA needs to know about SQLPSX, the PowerShell module library that is built by DBAs for DBAs, and designed to provide intuitive functions around the SMO objects. It makes the automation of database administration easier across all versions of SQL Server since SQL Server 2000. Laerte Junior, who is one of the developers on the open-source project, describes how to use it. Read more...

The PoSh DBA – Getting Airborne with PowerShell

Maybe the best way of helping the busy database professional to get started with practical PowerShell-based administration is to pull together all the essential community cmdlets into a toolkit for the POSH DBA, and explain how and why you'd use them. Read more...

The PoSh DBA – Getting to know PowerShell

Although it was primarily designed for System Administrators, PowerShell is now extending its use to Database, SharePoint, Exchange and all Microsoft products. In this article Laerte Junior offers an introduction to PowerShell and describes how DBAs can use PowerShell to automate repetitive tasks. He also explains when to use PowerShell instead of, or in addition to, T-SQL and SSIS. Read more...

The PoSh DBA: Solutions using PowerShell and SQL Server

PowerShell is worth using when it is the quickest way to providing a solution. For the DBA, it is much more than getting information from SQL Server instances via PowerShell; it can also be run from SQL Server as part of a system that helps with administrative and monitoring tasks. Laerte explains how. Read more...

The PoSh DBA - The Attributes of Advanced Functions

Once you pass that point of just hurriedly writing PowerShell scripts for immediate use and start to write PowerShell functions for reuse, then you'll want a robust set of parameters that allow functions to work just like cmdlets. Read more...

The PoSh DBA: Grown-Up PowerShell Functions

Laerte goes step-by-step through the process of tidying up and making more reusable an untidy collection of PowerShell routines, showing how pipelines and advanced functions can make PowerShell more effective in helping to automate many of the working DBA's chores. Read more...

Create a Monitoring Server for SQL Server with PowerShell

At some point, you are going to need a notification system for a range of events that occur in your servers, even if it is only a warning of low disk space. Laerte shows how you can even set up temporary or permanent alerts for any WMI events to give you a system that fits your server environment perfectly. Read more...

Using PowerShell and WMI Events Queries for Powerful Notifications

With PowerShell in one hand, and WMI in the other, DBAs can do almost anything in their Window's environments, and Laerte is using his powers for good. He built a highly precise, highly configurable alerting system for his servers, and now shows us exactly how he did it. Read more...

PowerShell Eventing and SQL Server Restores

When you're managing a large number of servers, it makes no sense to run maintenance tasks one at a time, serially. PowerShell is able to use events, so is ideal for, say, restoring fifty databases on different servers at once, and be notified when each is finished. Laerte shows you how, with a little help from his friends. Read more...

Fun with SQL Server Profiler trace files and PowerShell

Running Profiler traces against multiple servers becomes a painful process when it’s time to collate and filter all that data. It would be time-consuming, frustrating and messy if Laerte hadn’t written this handy PowerShell script (complete with examples) to help you out. Read more...

Gathering Perfmon Data with Powershell

When you have to routinely collect data from Performance Monitor Counters, it soon becomes easier and more convenient to use PowerShell. SQL Server MVP Laerte Junior was inspired to create a script, and guides us through its useful functions. Read more...

I'm a SQL Server DBA, and I'm in Love with PowerShell

To learn PowerShell, Laerte suggests that you just start using it. To encourage you to start, he provides a series of tips on using PowerShell with SQL Server to solve various everyday problems. With a little patience, a good IDE, and a bit of help and advice, "the lion is dead". Read more...

Exceptional PowerShell DBA Pt 3 - Collation and Fragmentation

In this final look into his everyday essentials, Laerte Junior provides some useful scripts for the DBA that use an alternative way of error-logging. He shows how to use a PowerShell script to check and, if necessary, to defragment your indexes, write data to a SQL Server table, and change the collation for a table. Being an exceptional DBA just got a little easier. Read more...

Exceptional PowerShell DBA Pt 2 - The Morning Checklist

Laerte Junior takes us further into the world of an Exceptional PowerShell DBA, showing us how he uses PowerShell 2.0 to take all the headaches out of even more of his daily checklist. What could be better than having your morning checklist run itself? Read more...

Exceptional PowerShell DBA Pt1 - Orphaned Users

Inspired by Brad McGehee's 'How to Become an Exceptional DBA', Laerte decided it was high time he took a proactive approach to his work. Using PowerShell, he came up with a solution that makes finding and fixing orphaned users as easy as cake, and now he's sharing it with us. Read more...

Reducing I/O with the 'Missing Indexes' DMVs

Laerte recently experienced an I/O nightmare, which, as a happy accident, gave him an opportunity to test out the ‘Missing Indexes’ DMVs and see if they were up to scratch. He solved his problems, ran a few tests to get a feel for how well the DMVs performed, and was very impressed. So much so, that he is sharing his findings with us. Read more...

Why Join

Over 400,000 Microsoft professionals subscribe to the Simple-Talk technical journal. Join today, it's fast, simple, free and secure.