Powershell删除执行问题 [英] Powershell remove execution issue
问题描述
嘿那里,
我试图通过一个PowerShell删除会话来执行exe文件,但却陷入了一些奇怪的境地......
我正在执行的exe是使用本地连接的使用凭证连接到数据库并从DB获取内容(IntegratedSecurity = true)
现在 - 当我用用户Manager连接到远程机器时通过远程桌面并运行exe - 它很好。
但是 - 当我通过powershell运行时:
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;
它打印出经理,这是正确的,现在看起来我与正确的用户经理连接,但当我尝试远程运行某些东西时 - 它执行一些NT AUTHORITY \ NOONYMOUS登录....
所以 - 我有点迷失在这里....
有什么想法吗?
提前致谢!
我的尝试:
尝试了各种执行exe的方法但总是用一些匿名登录用户执行它...
我还设置了WSManCredSSP以允许传递和接收凭证 - 仍然没有快乐。
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.
推荐答案
results = Invoke-Command -ComputerName Dust_1 -Credential
results = Invoke-Command -ComputerName Dust_1 -Credential
credentials -ScriptBlock {
credentials -ScriptBlock {
ArgList ='scope_Items_1',' - saveReport';
ArgList = 'scope_Items_1', '--saveReport';
这篇关于Powershell删除执行问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!