Skip to content

Setup Instructions

George Walkey edited this page Apr 8, 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.160.2004021.0\lib\net462\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
  • Version 1.60 has a dependency on .NET 4.62 or .NET Standard 2.0, so you also need to install those runtimes first
  • See Nuget Versions with: Find-Package -Name "Microsoft.SqlServer.SqlManagementObjects" -AllVersions -Source "https://www.nuget.org/api/v2"
  • See your installed versions with: get-package | where-object {$_.name -match 'SqlManagementObjects'} |sort version | ogv

Active Directory
If you want to resolve AD Group Members, you will need the RSAT (AD) Powershell Module.
Note RSAT only works in Windows Powershell 5.1
RTM of Powershell 7 shims in this version, so Powershell 7 is now supported!

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
Installing Windows 10 RSAT is more complicated:
There is a separate download for each Windows 10 Build
After the October 2018 Build, RSAT became a "Feature On Demand"
Also, you will need to reinstall RSAT after a major Windows 10 Build upgrade!

Clone this wiki locally