Book Image

SQL Server 2014 with PowerShell v5 Cookbook

By : Donabel Santos
Book Image

SQL Server 2014 with PowerShell v5 Cookbook

By: Donabel Santos

Overview of this book

Table of Contents (21 chapters)
SQL Server 2014 with PowerShell v5 Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Creating an SSISDB folder


In this recipe, we will create a folder in the SSISDB catalog.

Getting ready

In this recipe, we assume that the SSISDB catalog has been created. We will create a folder called QueryWorks inside the SSISDB catalog.

How to do it...

These are the steps required to create a folder in SSISDB:

  1. Open PowerShell ISE as an administrator.

  2. Import the SQLPS module as follows:

    #import SQL Server module
    Import-Module SQLPS -DisableNameChecking
  3. Load the IntegrationServices assembly as follows:

    Add-Type -AssemblyName "Microsoft.SqlServer.Management.IntegrationServices, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"    
  4. Add the following script and run it:

    $instanceName = "localhost"
    $connectionString = "Data Source=$instanceName;Initial Catalog=master;Integrated Security=SSPI"                       
    $conn = New-Object System.Data.SqlClient.SqlConnection $connectionString            
    $SSISServer = New-Object Microsoft.SqlServer.Management.IntegrationServices.IntegrationServices...