0

我正在尝试将服务器 A 上的以下 PowerShell 脚本运行到远程服务器 B ( REMOTE_PC ):

$username = 'domain1\user22'
$password = ConvertTo-SecureString -String 'PASSWORD' -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $password
Invoke-Command -ComputerName REMOTE_PC -scriptblock {DTExec.exe /File "C:\SQL\Test.dtsx"} -credential $Credential

它失败并出现以下错误:

Microsoft (R) SQL Server Execute Package Utility
Version 13.0.6300.2 for 64-bit
Copyright (C) 2016 Microsoft. All rights reserved.
Started:  10:56:47 AM
Progress: 2022-01-18 10:56:47.29
   Source: Upload Data from XXX to ZZZ
   Validating: 0% complete
End Progress
Progress: 2022-01-18 10:56:47.29
   Source: Upload Data from XXX to ZZZ
   Validating: 33% complete
End Progress
Error: 2022-01-18 10:56:57.36
   Code: 0xC0208449
   Source: ............................ [11]
   Description: ADO NET Source has failed to acquire the connection {91C2GHBA-1EA3-4218-9B91-7AE1EB4F7B4F} with the following error message: "Cannot open database "global_stam_db" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.".
End Error
Error: 2022-01-18 10:56:57.36
   Code: 0xC0047017
   Source: Upload Data from XXX to ZZZSSIS.Pipeline
   Description: Get Tests from XXX failed validation and returned error code 0xC0208449.
End Error
Progress: 2022-01-18 10:56:57.36
   Source: Upload Data from XXX to ZZZ
   Validating: 66% complete
End Progress
Error: 2022-01-18 10:56:57.36
   Code: 0xC004700C
   Source: Upload Data from XXX to ZZZSSIS.Pipeline
   Description: One or more component failed validation.
End Error
Error: 2022-01-18 10:56:57.36
   Code: 0xC0024107
   Source: Upload Data from XXX to ZZZ
   Description: There were errors during task validation.
End Error
DTExec: The package execution returned DTSER_FAILURE (1).
Started:  10:56:47 AM
Finished: 10:56:57 AM
Elapsed:  10.265 seconds

由于未知原因,运行此命令的用户变为匿名用户(而不是使用凭据发送的用户)。

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.".

知道为什么吗?

4

0 回答 0