Skip to content

Setup Instructions

George Walkey edited this page Feb 24, 2020 · 42 revisions

Unzip into a folder of your choice
Start a Powershell Console in that folder and run the master script 00_RunAllScripts.ps1
Passing in optional SQL Server [instance], [username], [password] parameters
(The scripts default to [locahost])
Each Script will create a sub-folder with the contents of the scripting action

Dependencies

DacFx Framework:
Docs
https://docs.microsoft.com/en-us/sql/tools/sqlpackage-download?view=sql-server-ver15
Direct Download:
https://go.microsoft.com/fwlink/?linkid=2113703
Changelog
https://docs.microsoft.com/en-us/sql/tools/release-notes-sqlpackage?view=sql-server-ver15

SMO:
MS has changed the deployment of SQL SMO to a NuGet package
https://docs.microsoft.com/en-us/sql/relational-databases/server-management-objects-smo/installing-smo?view=sql-server-ver15

  • In an elevated Powershell session
  • Install-Package Microsoft.SqlServer.SqlManagementObjects -skipdependencies
  • Load and Verify the DLL Version with
    Add-Type -Path 'C:\Program Files\PackageManagement\NuGet\Packages\Microsoft.SqlServer.SqlManagementObjects.150.18208.0\lib\net45\Microsoft.SqlServer.Smo.dll'
  • You cant use the generic Add-Type -AssemblyName “Microsoft.SqlServer.Smo” anymore , because it will load an older version of the DLLs, or a version from the GAC.
  • NuGet does not install these into the GAC

Or, you can install the latest SQL Developer or SSMS on your box, as SMO is included there as well

Active Directory
If you want to resolve Login Group Members, you will need the RSAT (AD) Powershell Module.
Note RSAT only works in Windows Powershell 5.1
There is NO Active Directory module for Powershell 6/7
When it comes out, Powershell 6/7 will become useful

RSAT for Windows 7:
https://www.microsoft.com/en-us/download/details.aspx?id=7887

RSAT for Windows 8.0
https://www.microsoft.com/en-us/download/details.aspx?id=28972

RSAT for Windows 8.1
https://www.microsoft.com/en-us/download/details.aspx?id=39296

RSAT for Windows 10
Windows 10 RSAT is more complicated:
There is a separate download for each Windows 10 Build
After the October 2018 Build, RSAT is a "Feature On Demand" install
You will need to reinstall RSAT after a major Windows 10 Build upgrade!

Clone this wiki locally