0

I'm trying to run the following PowerShell script on server A to a remote server 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

and it fails with the following error:

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

for unknown reason the user that runs this command turn to be ANONYMOUS (instead of the user sent with the creds).

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

Any idea why?

jarlh
  • 42,561
  • 8
  • 45
  • 63
ShaiO
  • 153
  • 1
  • 10
  • You might want to have a look at this solution: https://stackoverflow.com/questions/61018320/ssis-error-login-failed-for-user-nt-authority-anonymous-logon – Liny Jan 18 '22 at 10:05
  • Seems like a doulbe hop problem as mentioned in that link question – Nick.Mc Jan 18 '22 at 10:12

0 Answers0