Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. # Load the IntegrationServices Assembly
  2. [Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Management.IntegrationServices")
  3.  
  4. # Store the IntegrationServices Assembly namespace to avoid typing it every time
  5. $ISNamespace = "Microsoft.SqlServer.Management.IntegrationServices"
  6.  
  7. Write-Host "Connecting to server ..."
  8.  
  9. # Create a connection to the server
  10. $sqlConnectionString = "Data Source=localhost;Initial Catalog=master;Integrated Security=SSPI;"
  11. $sqlConnection = New-Object System.Data.SqlClient.SqlConnection $sqlConnectionString
  12.  
  13. # Create the Integration Services object
  14. $integrationServices = New-Object $ISNamespace".IntegrationServices" $sqlConnection
  15.  
  16. # Provision a new SSIS Catalog
  17. $catalog = New-Object $ISNamespace".Catalog" ($integrationServices, "SSISDB", "P@assword1")
  18. $catalog.Create()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement