【问题标题】:How can I solve the issue I have with PsExec?如何解决 PsExec 的问题?
【发布时间】:2017-04-20 09:21:40
【问题描述】:

当我使用 PsExec 执行程序时,我测试 Internet 连接的方法不起作用。 它显示此消息:

“远程服务器返回错误:(403) Forbidden”**

我需要远程执行应用程序,这就是我使用 PsExec 的原因,但是当我不使用 PsExec 打开程序时,该方法运行正常。

我使用 PsExec 执行程序的命令:

"D:\PsExec.exe -s -i \\MK18455 D:\RemedyHealthCheck.exe "

方法:

Public Shared Function CheckForInternetConnection(link As String) As String
    Try
        Dim proxy As New WebProxy("ibproxy03.intranet.ibermatica:8080", True)
        proxy.UseDefaultCredentials = True

        Dim request As HttpWebRequest = WebRequest.Create(link)
        request.Credentials = CredentialCache.DefaultCredentials
        request.Proxy = proxy


        Dim response As HttpWebResponse = request.GetResponse()

        If response.StatusCode = HttpStatusCode.OK Then
            Return "si"
        Else
            Return "no"
        End If
    Catch e As Exception
        MsgBox(e.Message)
        Return "no"
    End Try

End Function

【问题讨论】:

  • 定义“不工作”。有错误提示吗?
  • @AFriend 是的,它显示一条消息:“远程服务器返回错误:(403) Forbidden”
  • 我看到您使用的是默认凭据。如果您尝试远程访问,则需要提供正确的凭据
  • @AFriend 例如?
  • @AFriend 因为我已经尝试使用我正在访问的计算机的用户名和密码

标签: vb.net windows command psexec


【解决方案1】:

您正在使用错误的用户运行 psexec。当您设置 -s 标志时,您实际上是以 SYSTEM 帐户运行的,但您的 Web 服务器/代理需要身份验证。您应该允许该计算机绕过身份验证或删除 -s 标志,假设允许运行 psexec 的用户访问该网络服务器/代理。另一种选择是手动将 -u 标志设置为允许的用户。 (如果您不是以该用户身份运行,则需要密码)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-10-25
    • 2018-07-07
    • 2019-01-30
    • 2019-09-21
    • 2021-09-10
    • 2019-12-28
    • 1970-01-01
    相关资源
    最近更新 更多