Hey there,
I am trying to execute exe file through a powershell remove session, but got stuck with some oddness...
The exe that I am executing is connecting to a database using local connected used credentials and gets the stuff from DB (IntegratedSecurity = true)
Now - when I connect to the remote machine with user "Manager" through remote desktop and run the exe - it's fine.
But - when I run this through powershell:
$results = Invoke-Command -ComputerName Dust_1 -Credential $credentials -ScriptBlock {
$ArgList = 'scope_Items_1', '--saveReport';
$ps = Start-Process 'C:\DataComparer\Comparer.exe' -ArgumentList $ArgList -NoNewWindow -Wait
return $ps;
}
I am getting an error: "
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'
"
Any ideas what is happening here?
I even tried executing this inside the script block:
Write-Host $env:UserName;
And it printed out "Manager" and that is correct and now it looks like I am connected with the right user "manager", but when I try to run something remotely - it executes as some NT AUTHORITY\ANONYMOUS LOGON....
So - I'm kind of lost here....
Any thoughts?
Thanks in advance!
What I have tried:
tried various ways of executing the exe but it always executes it with some anonymous logon user...
I've also set the WSManCredSSP to allow to pass and receive credentials - still no joy.