Chad Miller
Restore and Relocate Database Files Using PowerShell
I was recently asked a question on restoring a database using PowerShell with the following requirements
- Take a database backup file i.e. DatabaseName.bak
- Derive the database name from the backup file name
- Disconnect any user connected to the database
- Relocate (move) the physical files to SQL Serve r instance the…
0 comments, 1,011 reads
Posted in Chad Miller on 14 March 2011
SQLPSX 2.3.2.1 Release
We’ve released a minor update to SQLPSX which includes includes several bug fixes/enhancements as well as one new module. Here’s an excerpt from the release notes:
Added MySQLLib Module
Mike Shepard created a MySQL module for querying MySQL databases. This is similar in concept to the adolib and OracleClient modules. Read more
1 comments, 220 reads
Posted in Chad Miller on 13 March 2011
T-SQL Tuesday #15 Automation and the SSIS Dumper
This post is my contribution to T-SQL Tuesday, hosted this month by Pat Wright (blog | twitter).
In my previous post Importing and Exporting SSIS Packages Using PowerShell I showed you how to import/export SSIS stored in MSDB to and from the file system. In this post… Read more
3 comments, 243 reads
Posted in Chad Miller on 8 February 2011
Importing and Exporting SSIS Packages Using PowerShell
SQL Server PowerShell Extensions (SQLPSX) includes a set of function for working with SSIS which among other things allow you to import and export SSIS packages between the file system and msdb. The functionality is best illustrated by looking a few examples.
Creating an SSIS folder
Note: The SSIS module… Read more
1 comments, 1,280 reads
Posted in Chad Miller on 3 February 2011
Tampa IT Camp Saturday
The first annual Tampa IT Camp will be held on Saturday, March 19th 2011.
What’s an IT Camp?
In the spirit of Code Camps, SQL Saturdays and SharePoint Saturdays an IT Camp is an event focused on IT Pro aka system administrators. Visit http://ITCampSaturday.com/ to learn more about IT Camps. Read more
0 comments, 91 reads
Posted in Chad Miller on 22 January 2011
SQL Saturday #62
I presented a one hour session at SQL Saturday #62 in Tampa on SQL Server PowerShell Extensions (SQLPSX): “In this sesssion we will look at how the CodeProject SQLPSX can be used for real world PowerShell automation. Specific topics covered include using ADO.NET, retrieving SQL Server information, SSIS administration, Policy-Based… Read more
0 comments, 87 reads
Posted in Chad Miller on 15 January 2011
Making an Operations Manager Module
Operations Manager 2007 R2 ships with Operations Manager Shell which is simply a provider with associated cmdlets for working with System Center Operations Manager. The Operations Manager implementation of PowerShell uses a console file which limits reusability, however we can easily build our own Operations Manager Module…
Creating the…
0 comments, 118 reads
Posted in Chad Miller on 4 January 2011
Windows Cluster Scripting with WMI and PowerShell
Windows 2008 R2 includes a failoverclusters PowerShell module, but you’ll probably find normal usage limiting for several reasons:
- Only works on Windows 2008 R2 clusters
- Requires the cluster service which in effect makes it difficult to run remotely except via PSRemoting
- Implements specialized data types instead of using WMI
Although… Read more
0 comments, 783 reads
Posted in Chad Miller on 31 December 2010
PBM and PowerShell
The best new management feature added to SQL Server 2008 is Policy Based Management or PBM. PBM allows DBAs to automate many of the traditional daily (or more frequent) checklists*. Although PBM is useable out-of-box there are several key features missing:
- Unable to capture results of policy evaluations…
4 comments, 810 reads
Posted in Chad Miller on 25 December 2010
SQLPSX 2.3.1 Release
We’ve released a minor update to SQLPSX which includes several bug fixes as well as two new modules. Here’s an excerpt from the release notes:
Added PerfCounters Module
The PerfCounters module contributed by Laerte Junior (blog|twitter), is used for working with Windows Performance Counters, collecting and… Read more
2 comments, 210 reads
Posted in Chad Miller on 11 December 2010
What’s Going on with SQL Server Service Account Changes?
For years we’ve been told you should use Enterprise Manager in SQL Server 2000 or SQL Server Configuration Manager in SQL 2005 or higher to change the SQL Service account. Why you may ask well, because according to the documentation Configuration Manager does “magic” stuff to re-ACL things for the… Read more
15 comments, 1,097 reads
Posted in Chad Miller on 10 December 2010
Executing PowerShell in SQL Server Redux
A while ago I blogged about using xp_cmdshell to execute a PowerShell script in SQL Server and return a result set. At that time I was using PowerShell V1, but now with PowerShell V2 I can clean this up a little. The improved version uses the built-in PowerShell V2 cmdlet… Read more
1 comments, 536 reads
Posted in Chad Miller on 30 November 2010
Determining An Enterprise Execution Policy Setting
Windows PowerShell has the concept of execution policy that determines in which cases script and configuration files are able to run. The various execution policy settings are described in about_Execution_Policies. Run Get-Help about_execution_policies or see the online version for additional information.
The default setting for the execution policy is restricted… Read more
1 comments, 868 reads
Posted in Chad Miller on 28 November 2010
Building A PowerShell Module Installer
As part of the 2.3 build of SQLPSX I built an MSI based installer to package all 10 SQLPSX modules. The installer was created with Windows XML Installer (Wix). To build an MSI using Wix you manually edit XML files and run several command-line tool to generate the necessary files.… Read more
0 comments, 420 reads
Posted in Chad Miller on 23 November 2010
SQL Services on Laptop
I run several SQL Server instances on my laptop, however I’ll keep the services shutdown to conserve resources and then start up the instance when needed. Doing this type of stuff through the GUI results in several clicks
- Right click on SQL instance in SSMS
- Select Service Control >> Start…
2 comments, 73 reads
Posted in Chad Miller on 19 November 2010
SQLPSX 2.3 Release
Just in time for PASS Summit 2010, the CodePlex project SQL Server PowerShell Extensions (SQLPSX) has been updated . Here’s a rundown of what’s new in release 2.3…
Added MSI-based installer
The installer was built using the Windows Installer XML (WiX) and this was an… Read more
0 comments, 629 reads
Posted in Chad Miller on 6 November 2010
Scripting Guy Guest Blog Post
Ed Wilson (Blog|Twitter) aka Scripting Guy is kicking off a SQL Server week (Nov 1st 2010) with my guest blog post. The post, Use PowerShell to Collect Server Data and Write to SQL, demonstrates my number one use case for database related PowerShell activities—loading data… Read more
0 comments, 115 reads
Posted in Chad Miller on 2 November 2010
Using Symlinks in PowerShell Scripts
Symlinks are heavily used in Linux/Unix environments to provide an abstraction for file and directory locations and with the introduction of symbolic links in Vista/Win7/Windows 2008 we can take advantage of this handy little feature. One use case for symlinks in Linux scripting is to setup a link to a… Read more
0 comments, 226 reads
Posted in Chad Miller on 15 October 2010
Upcoming October Events
During October I’ll be presenting at several online and in-person events
| Location | Date | Session |
| SQL Saturday #49 Orlando 2010 | Oct 16th | ETL with PowerShell |
| PASS PowerShell VC | Oct 20th | Introduction to PowerShell |
| World Wide Online Tech Day 2010 | Oct 30th | ETL with PowerShell |
Orlando SQL Saturday features a full PowerShell… Read more
0 comments, 181 reads
Posted in Chad Miller on 6 October 2010
A Really Simple Data Dictionary
Last month I sat down with Blain Barton and TechNet Edge in an interview (Blain Barton Interviews Raymond James Chad Miller on PowerShell) and described a PowerShell-based solution for providing a classic centralized data dictionary of various data sources to our IT users. I’m pleased to announce I’ve… Read more
0 comments, 211 reads
Posted in Chad Miller on 26 August 2010



Subscribe to this blog