SSIS部署Powershell集成身份验证错误

时间:2019-07-25 12:52:44

标签: sql-server powershell deployment ssis

我正在尝试使用Powershell将具有SQL Server身份验证的SSIS项目部署到虚拟机上。

据我所知,通过SQL Server身份验证可以部署SSIS。我需要在服务器端进行一些更改吗?

脚本:

$ServerName = "XX.XX.XX.XX"
$UserName = "test"
$UserPassword = "test"

$SSISCatalog = "SSISDB"
$ProjectFilePath = "C:\ReleaseProcess\Test.ispac"
$ProjectName = "Test"
$FolderName = "Test"

# Load the IntegrationServices Assembly
[Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Management.IntegrationServices")

# Store the IntegrationServices Assembly namespace to avoid typing it every time
$ISNamespace = "Microsoft.SqlServer.Management.IntegrationServices"

Write-Host "Connecting to server ..."

# Create a connection to the server

$sqlConnectionString = "Data Source=$ServerName;Initial Catalog=master;User ID=$UserName;Password=$UserPassword;TrustServerCertificate=True;"
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection $sqlConnectionString

Write-Host "Connected"
$integrationServices = New-Object "$ISNamespace.IntegrationServices" $sqlConnection
$catalog = $integrationServices.Catalogs["SSISDB"]
$folder = $catalog.Folders[$FolderName]

# Read the project file, and deploy it to the folder
Write-Host "Deploying Project ..."
[byte[]] $projectFile = [System.IO.File]::ReadAllBytes($ProjectFilePath)
$folder.DeployProject($ProjectName, $projectFile)

我得到的错误

  

使用“ 2”作为参数调用“ DeployProject”的异常:“该操作无法由使用SQL Server身份验证的帐户启动。请使用具有集成身份验证的帐户启动该操作。”第38行:char: 1

0 个答案:

没有答案