PSEXEC抛出错误消息,但没有任何问题的作品 [英] PsExec Throws Error Messages, but works without any problems
问题描述
所以我们使用PSEXEC很多我们的自动化安装虚拟机,因为我们不能用我们的Windows 2003的计算机上使用PS远程会话。一切都很正常,没有问题,但PSEXEC不断抛出的错误,甚至每一个命令正在紧张进行,而不正确。
例如:
So we are using PsExec a lot in our automations to install virtual machines, as we can't use ps remote sessions with our windows 2003 machines. Everything works great and there are no Problems, but PsExec keeps throwing errors, even every command is being carried out without correctly. For example:
D:\tools\pstools\psexec.exe $guestIP -u $global:default_user -p $global:default_pwd -d -i C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command "Enable-PSRemoting -Force"
启用guest虚拟机上PsRemoting,也引发此错误消息:
Enables the PsRemoting on the guest, but also throws this error message:
psexec.exe :
Bei D:\Scripts\VMware\VMware_Module5.ps1:489 Zeichen:29
+ D:\tools\pstools\psexec.exe <<<< $guestIP -u $global:default_user -p $global:default_pwd -d -i C:\Windows\System32\WindowsPowerShell\
v1.0\powershell.exe -command "Enable-PSRemoting -Force"
+ CategoryInfo : NotSpecified: (:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com
Connecting to 172.17.23.95...Starting PsExec service on 172.17.23.95...Connecting with PsExec service on 172.17.23.95...Starting C:\Windows\
System32\WindowsPowerShell\v1.0\powershell.exe on 172.17.23.95...
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe started on 172.17.23.95 with process ID 2600.
这类错误消息apear总是不管我如何使用PSEXEC,喜欢用引号,用vriables /固定值,其他标志等是否有人有一个想法如何,我可以解决这一问题?这不是一个真正的问题,但它使发现错误在一个痛苦的屁股,因为错误是无处不在。禁用PSEXEC的错误信息都还将有助于...
These kinds of error messages apear ALWAYS no matter how i use psexec, like with quotes, with vriables/fixed values, other flags, etc. Does anybody has an idea how i could fix this? It is not a real problem, but it makes finding errors a pain in the ass, because the "errors" are everywhere. Disabling the error messages of psexec at all would also help...
推荐答案
这是因为PowerShell中有时会报告一个NativeCommandError当一个进程写入STDERR。 PSEXEC写入信息热线
This is because PowerShell sometimes reports a NativeCommandError when a process writes to STDERR. PsExec writes the infoline
PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com
要STDERR,这意味着它可能会导致此。
to STDERR which means it can cause this.
有关详细信息,请参阅这些问题/回答:
For more information, see these questions / answers:
- http://stackoverflow.com/a/1416933/478656
- http://stackoverflow.com/a/11826589/478656
- http://stackoverflow.com/a/10666208/478656
- http://stackoverflow.com/a/1416933/478656
- http://stackoverflow.com/a/11826589/478656
- http://stackoverflow.com/a/10666208/478656
这篇关于PSEXEC抛出错误消息,但没有任何问题的作品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!