Category Archives: SQLServerPedia

Delegated SQL Server Administration with Powershell

Providing delegated administration to groups that need to perform various security functions has always been a difficult task, but thanks to Powershell V3 (currently in CTP 1 as of this blog post) and PowerGUI we have new tools to provide a solution. The Problem You have groups outside of database administration that need to have…

Gaining SQL Server SysAdmin Access

I’ve seen this come a few times at work and I’m sure most you have experienced something similar. Someone or an application installs SQL Server, doesn’t grant access to the DBA group and asks for DBA support. In SQL Server 2008 and higher the built-in local administrators group is no longer automatically part of the…

Managing AlwaysOn with Powershell

Although you can use SQL Server Management Studio or T-SQL to manage AlwaysOn, SQL Server Denali CTP 3 includes 25 cmdlet which together provide complete coverage for creating, confiiguring and administering the AlwaysOn database feature. In this post we’ll look at using Powershell to perform various management tasks for AlwayOn. Note: This blog post describes…

Recursively Enumerating Local and AD Groups

If you ever need to flatten out groups which may include nested local and AD groups there’s a really easy way to do this in  the System.DirectoryServices.AccountManagement.GroupPrincipal GetMembers method. Here’s some PowerShell code which works against both local and AD groups. The code can easily be adapted into a function and in fact I’m using…

Using SMO Transfer Class to Script Database Objects

I’ve spent some time trying to get the SMO Transfer class to bend to my will. I want to script out all objects of a certain type or a select list of objects. As we will see a moment this was a bit a of challenge and it wasn’t until I had given up ,…

Denali SQLPS First Impressions

I’ve taken a few hours to try out Denali CTP 3 sqlps and noticed some welcome changes.  The biggest change for sqlps is that it has been implemented as module and plain old Powershell host–It’s no longer mini-shell! SQLPS Host SQLPS is now regular Powershell host implemented as the familiar sqlps.exe. Prior versions of sqlps…

Creating Icons Files

While working on a PowerPack for PowerGUI I needed to create a bunch of icon files from bitmaps files so I started with a quick web search. I didn’t find any PowerShell scripts suited to the task, but did find an excellent  C# WinForm by Haresh Ambaliya: http://code.msdn.microsoft.com/Convert-Image-file-to-Icon-c927d9f7 Although the C# app is useful, it…

MVP Award

Today on July 1st 2011, I was pleasantly surprised to be recoginzed as a Microsoft Most Valuable Professional for contributions to the PowerShell technical communities: To the many who have helped me, Microsoft, and the PowerShell community, thank you! –Chad Miller

T-SQL Tuesday 19 Disasters and Recovery

This post is my contribution to T-SQL Tuesday, hosted this month by Allen Kin (blog | twitter). A first step in any disaster recovery planning is inventorying your database servers. Although having having an up-to-date list of SQL Servers sounds simple enough the reality is in an enterprise environment SQL Servers are bit like mushrooms—they suddenly crop…

Use ACE Drivers and PowerShell to Talk to Text Files

As a follow up to my SQLRally 2011 Scripting Guy Guest Blog Post which dealt with Excel and Access files, this post explorers working with delimited text files using the ACE driver. What about Import-CSV? One of the first things I do when working with PowerShell is first look at the built-in cmdlets. PowerShell has…