Azure Stack TP2: SQL Resource Provider Install Error – System.Management.Automation.ValidationMetadataException: The argument is null or empty.

When installing the SQL Resource Provider on Azure Stack TP2, I encountered the following error:

VERBOSE: Download of SQLServer Failed. (Elapsed: 00:00:00.0386220)
WARNING: Can not execute [C:\Users\AzureStackAdmin\Desktop\Resource
Providers\SQL\Prerequisites\BlobStorage\Download-File.ps1] command at 1 time(s). Will retry. The error:
System.Management.Automation.ValidationMetadataException: The argument is null or empty. Provide an argument that is
not null or empty, and then try the command again.
at System.Management.Automation.ValidateNotNullOrEmptyAttribute.Validate(Object arguments, EngineIntrinsics
at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter,
CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)

When starting the deployment process I specified a local path to the SQL Server ISO file, as opposed to having the setup download it for me.  The issue comes from the way that the install script reads the path value specified…

As you can see, the DependancyFilesLocalPath is passed directly to a Get-ChildItem command which is in turn passed to the Download-File command.  The issue was that I had placed the ISO in the same folder as the rest of the SQL RP scripts, and that folder included subfolders.  I resolved the error by moving the ISO to it’s own subfolder and updating the DependancyFilesLocalPath parameter accordingly.

Azure Stack TP2: Install Error – Function ‘ConfigureAAD’ in module ‘Roles\AAD\AAD.psd1’ raised an exception: The remote server returned an error: (401) Unauthorized


While running InstallAzureStackPOC.ps1 to install Azure Stack TP2, I encountered the following error:

Function ‘ConfigureAAD’ in module ‘Roles\AAD\AAD.psd1’ raised an exception: The remote server returned an error: (401) Unauthorized

I did some digging online and found a helpful thread on the MDSN Azure Forum.

The issue turned out to be that the system clock was one hour behind on the Azure Stack host and all of the VMs created by the install process.  This causes the communication from the MAS-WAS01 machine to Azure Active Directory to fail. I opted to correct the time separately on each server, but this would also be the perfect candidate for automating with a single script.  Perhaps using something like this?

Once the time was corrected throughout the environment, I was able to resume where I left off using the following command:

Note: if you are using a new PowerShell session, you will have to run the following commands to import the required modules:

With the time corrected I was able to complete the installation without any additional errors.

Upcoming Events for Fall 2012

I will be attending the following events in the upcoming months:

Tampa IT Pro Camp – Saturday, September 22nd 2012 in Tampa, Florida

At this event I’ll be presenting my “Intro to SQL Server for IT Professionals” session.

Oracle OpenWorld – Sunday, September 30th – October 4th 2012 in San Francisco, California

I’ll be an attendee as well as participating as a panel member in the Real-World Operational Reporting with Oracle GoldenGate: Customer Panel 

Oregon SQL Saturday #172 – Saturday, November 3rd 2012 in Portland, Oregon

I’m still waiting for the schedule to be announced before I know if I’ll be speaking, but I will definitely be attending.

PASS Summit 2012 – Tuesday, November 6th – 9th 2012 in Seattle, Washington

This will be my 5th consecutive PASS Summit and my first year as an alumni mentor.  This is the premier conference for SQL Server and an event that I look forward to all year.

Olympia SQL Saturday #166 – Saturday, November 10th 2012 in Olympia, Washington

I’m still waiting for the schedule to be announced for this event as well, but I will definitely be attending.

An event that has unfortunately fallen off of my list, but still needs to be mentioned –

Orlando SQL Saturday #151 – Saturday, September 29th 2012 in Orlando, Florida 

This was the original SQL Saturday event and never disappoints.  I’m really sorry that I’m going to miss this year’s event, but will all of the upcoming travel I need to spend some quality time with my wife.

This fall is going to be very busy, but I’m looking forward to the challenge.

The Lost Documentation: Add-WindowsFeature

I was recently working on a PowerShell script to install a Windows feature and while reviewing the documentation for the cmdlet I found something missing…


The documentation shows the return type as being an object of type Microsoft.Windows.ServerManager.Commands.FeatureOperationResult, but I couldn’t find any information about that class.  In the MSDN documentation that class would typically be a hyperlink to another page that explains the properties and methods for that object as well as links to any related objects.  Call me spoiled, but I find it much easier to code against an object when I know what it looks like.

Given that I couldn’t find the information anywhere online, I figured I would document it within my own blog, in the hope that I can save some time for somebody else.  The following information was gathered using the Get-Member cmdlet against the root object and it’s child objects.





So, now that we understand the objects involved, how do we make use of it?  Well, here’s an example:

First, let’s install a couple of features and assign the result to a variable (I’ve chosen to install multiple features to demonstrate looping through the FeatureResult array)


Here’s what the variable looks like


Now, let’s use it to view the individual results


From here you can do all kinds of things like check to see if the install was successful or if the install requires a restart, both are boolean values that can be easily checked with an IF statement.

Note: This works in Windows Server 2012, but the cmdlets have changed from Add-WindowsFeature and Remove-WindowsFeature to Install-WindowsFeature and Uninstall-WindowsFeature.

Happy New Year!


I hope you had a safe and happy holiday season.  To help ring in the new year I have published a new update to the SQL SPADE open source project found at  This update furthers the SQL 2012 support added in the 1.1 release by now supporting installs of SQL 2012 on Windows Server Core.  I feel that this is one of the biggest areas of benefit for SPADE considering the steep learning curve that you face when you start working with Server Core.  You don’t realize just how much you rely on graphical tools and wizards until they’re gone.  Running SPADE turns installing SQL Server into running a single PowerShell function, no GUI needed.

Along with the support for Server Core, the following enhancements have been make to SPADE release 1.2:

  • Added QtWeb (Open Source) standalone browser for viewing the SQL SPADE log on Server Core – I still prefer this over writing the log to a plain text file that would have to be searched for errors
  • Changed the Set-SqlTcpPort logic to use the WMI method because the registry method was inconsistent when installing SQL 2012 on Server Core 
  • Fixed the exists check in the VerifyAdminGroup script to look for the fully qualified domain group
  • Fixed a logic error in the Execute-SqlCommand function that was masking exceptions when the SQL connection failed
  • Added support for excluding scripts by putting an “_” at the beginning of the file name – when a script is excluded the install will log that the script is being skipped because it has been marked as excluded
  • Changed the ConfigureDatabaseMail script to a PowerShell script that uses external configurations stored in the Run-Install.config file – this change was to enforce the pattern of all script variables being centralized in the configuration file and simplifies implementation for new environments 
  • Changed the order for the RemoveBuiltinAdminsLogin script – moved this script to the end of the process so it is not executed in the event of a critical failure
  • Changed the order for the Restart-SqlService script – moved this to the end of the process because the time needed to restart the service could cause failures in subsequent SQL scripts

I have also added script management functionality to the SqlSpadeHelper tool.  Watch here for an upcoming article that details how to use it to manage your scripts.

Would You Like to Save Some Time?

Creative Commons -

Sure, we all would!

What if I told you that there was a new project on codeplex that could has saved hundreds of hours for my organization and could do the same for you?  Well, this weekend marks the first public release of the Scripted PowerShell Automated Deployment Engine (SPADE) for SQL Server and that is exactly what it’s designed to do. 


I believe that any repetitive task is a potential candidate for automation, and installing SQL Server is no different.  You may say “I already automate my installs using an unattended configuration file”, but that only addresses part of the problem.  What about those changes you have to make prior to the install?  Things like configuring Microsoft Distributed Transaction Coordinator (MSDTC), or changing the TCP Offload Chimney setting?  Then, once your install is complete, your job still isn’t done.  My shop, like most companies, has a list of things that need to be done after the install like setting up Database Mail, creating Operators, deploying standard Stored Procedures, and the list goes on.  What if there was a way to automate the entire process from beginning to end?  Well, now there is…


SPADE is a process that I have created that does exactly that.  The process is PowerShell based and completely customizable for any organization.  I built the system to be folder based, so adding new Pre Install or Post Install tasks is as easy as dropping a new script into a folder. 


The SPADE process is very simple and mimics the same process that you would follow if you were installing manually.  It processes a list of Pre Install tasks, creates the unattended install file for you, installs SQL Server, and then processes a list of Post Install tasks.  The difference is that SPADE leverages the awesomeness that is PowerShell to modify those configurations for you, so you don’t have to navigate through multiple different application interfaces to get it done.  Fewer clicks means that you can move on to something else faster.


You can download SPADE from


The initial beta release is available now, so what are you waiting for?

The Catch…

This system currently supports Standalone (Not clustered) installs of SQL Server 2005, 2008, and 2008R2.  I am currently working on support for “Denali” and will have that available once it has RTM’d.  Also, while I have tested the Database Engine components and Integration Services, I have not tested the install of Reporting Services or Analysis Services yet.  Any volunteers would be greatly appreciated.


This is beta software, and should be treated accordingly.  My team has used this software in my organization for many months and saved hundreds of hours in the process, but every environment is different.  Once I have received sufficient feedback and addressed any issues that have been identified I will remove the “Beta” designation.

Many months have gone into preparing this release and I hope that you find it as valuable for automating SQL Server installs as I have.

My Shot At The Majors…

Last year I made a difficult decision to leave an organization that I had been part of for 8 years.  I had developed very close relationships with so many people and I still care very much about the success of the organization, but I needed make the change for my continued growth.   

As a direct result of that decision this year has become a significant building year for me, and to continue that growth I have submitted my first abstract to speak at the Professional Association for SQL Server (PASS) Summit this October in Seattle, Washington.


There are a number of reasons that a person would want to speak at a large conference like this, but the major factors for me are:

– The opportunity to grow as a speaker

– To share a technology I am passionate about


The opportunity to grow as a speaker

I spoke at my first technology event back in 2007 at the Tampa Code Camp.  Since then I have had the privilege of speaking at Code Camps, SQL Saturdays, and most recently at the first ever IT Camp in Tampa.  I love being able to help others by sharing my knowledge and always appreciate the chance to learn from them too.  The next logical seemed is to submit for a larger event, and given my love of SQL Server, where else would I go but to PASS.

To share a technology I am passionate about

Anybody that knows me will tell you that I am a geek to the core.  I love technology, but even more than that, I love using technology to solve problems.  The purpose of technology is to make a task or process faster, easier, and less prone to error. That thought process works not just for the users we support, but for us as well.  I am always looking for ways save time and make common tasks easier.

That pursuit has led me to my latest project, a streamlined deployment engine for SQL Server that is written in PowerShell.  This process is currently being used in my organization and has already saved us hundreds of hours by reducing the time it takes to stand up a new SQL Server instance to 20 minutes.  This includes everything from configuring MSDTC and verifying drive access, installing SQL Server, and then deploying all of our standard objects like databases, stored procedures, and agent jobs.       

I feel so strongly that this process can help others that I have turned it into a CodePlex project for the entire community to use.  I have found that public speaking is easier for me when I am passionate about the subject matter, and I have been so excited about this project that it seemed like the perfect session to submit to PASS.

What’s Next?

As I work towards my first release of the project I will post articles explaining what it does, how it works, and how it can be easily customized for your organization.  I will also continue to speak about at various events including the following:

SQL Saturday #77 – June 4th – Pensacola, Florida

The Orlando PASS User Group Meeting – June 14th – Orlando, Florida

The PASS PowerShell Virtual Chapter Meeting – June 15th – Webcast

If you are interested in finding out more about the project, please join me at any of the above events.  If you are a member of PASS, please log on by the end of the day on May 20th and vote for my session in the Summit survey.   And, if you are not a member of PASS, please consider joining.


Welcome to my blog.  I’d like to start off by introducing myself…I’m a DBA for a large financial firm in Florida, but I have a background in networking and .Net development.  This means that my posts could cover just about anything, but will be mostly focused on the administration of SQL Server and how PowerShell can be used to make that easier.

I hope that you find my content interesting and welcome any feedback that you have.