gpt4 book ai didi

visual-studio - Visual Studio 内的 psexec

转载 作者:行者123 更新时间:2023-12-03 01:18:07 25 4
gpt4 key购买 nike

我一直在尝试让 psexec 通过 Visual Studio 中的自定义构建任务在远程计算机上运行可执行文件。所有这些命令都可以从命令行运行,但从应用程序运行它似乎是一个问题。有些命令可以工作,但其他 psexec 会挂起,因此 msbuild 和 Visual Studio 2005 也会挂起。在这种情况下,我调用 SharePoint 的 stsadm.exe,但从应用程序运行 psexec 时,很多程序都会出现此问题。有很多人遇到这个问题,但似乎没有解决方案,所以我的问题是:有人知道 psexec 的可行替代方案吗?

最佳答案

在对远程系统执行 PSEXEC 时,我经历过“挂起”,但我总是将其归因于远程进程运行所在的安全上下文。

来自 PSEXEC 帮助:

If you omit a username the remote process runs in the same account from which you execute PsExec, but because the remote process is impersonating it will not have access to network resources on the remote system. When you specify a username the remote process executes in the account specified, and will have access to any network resources the account has access to. Note that the password is transmitted in clear text to the remote system.

如果您远程执行进程,然后需要访问数据库 (stsadm.exe),则尝试访问网络资源可能会失败,具体取决于 PSEXEC 的执行方式。如果是这样的话,我想它最终会超时并给出某种资源不可用的消息。

在对远程计算机执行部署步骤时通常会执行两件事,以防止出现您所描述的行为:

  1. 就像 rifferte 提到的那样,确保所需的所有 Assets 部署是本地到远程机器(复制文件等)之前使用 PSEXEC 执行脚本(*.bat、*.vbs、*.ps 等)-这样一切都“本地”运行远程机器。

  2. 使用以下命令运行 PSEXEC域用户名/密码执行它 - 请注意,这信息以明文形式传递到远程服务器。

关于visual-studio - Visual Studio 内的 psexec,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/519848/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com