AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[remoting](server)

Martin Hope
Usman
Asked: 2020-08-29 05:15:42 +0800 CST

如何从本地使用 powershell 连接到远程服务器。Enter-PSSession 不工作(不相关的 Exchange 服务)

  • -1

我正在尝试使用本地 powershell 会话连接到远程计算机。

为此,我尝试使用本地 powershell Enter-PSSession 或 New-PSSession 命令作为:

$session = New-PSSession -ConnectionUri 'http://testserverUri.dom/PowerShell'

但是我总是在异常之后得到。

New-PSSession : [testserveruri.dom] Connecting to remote server apdv0710.forest7.dom failed with the following
error message : The WinRM client sent a request to an HTTP server and got a response saying the requested HTTP URL was
not available. This is usually returned by a HTTP server that does not support the WS-Management protocol. For more
information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:12
+ $session = New-PSSession -ConnectionUri 'http://testserverUri.dom/ ...
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
   gTransportException
    + FullyQualifiedErrorId : URLNotAvailable,PSSessionOpenFailed

我还使用了其他变体:

    Enter-PSSession -Authentication Kerberos -ConnectionUri 'http://testserveruri.dom/PowerShell' -Cred $credential
    Enter-PSSession : Connecting to remote server apdv0710.forest7.dom failed with the following error message : The WinRM
    client sent a request to an HTTP server and got a response saying the requested HTTP URL was not available. This is
    usually returned by a HTTP server that does not support the WS-Management protocol. For more information, see the
    about_Remote_Troubleshooting Help topic.
    At line:1 char:12
    + $session = Enter-PSSession -Authentication Kerberos -ConnectionUri 'h ...
    +            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (http://testserveruri.dom/PowerShell:Uri) [Enter-PSSession], PSRemot
       ingTransportException
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

在大多数情况下,我得到了第一个例外。

当我使用 C# 打开运行空间并为 WSManConnectionInfo 对象提供远程服务器 powerSell url 时,也会发生同样的异常。

我已经对 winrm 命令进行了各种处理,但这并不能真正解决问题。如何摆脱这个问题?

powershell remoting winrm ps
  • 2 个回答
  • 1540 Views
Martin Hope
rhellem
Asked: 2020-06-25 09:21:09 +0800 CST

Powershell - 调用命令不运行 msiexec.exe

  • 1

我想在一堆服务器上安装 TortoiseSVN 客户端,使用 Powershell 远程处理。基本操作有效,但以下命令无法远程处理

Invoke-Command -ComputerName myserver -ScriptBlock {Start-Process "msiexec.exe" -ArgumentList "/i \\fileserver\install\subversionclients\TortoiseSVN-1.14.0.28885-x64-svn-1.14.0.msi  /passive /norestart /qn ADDLOCAL=ALL" -Wait}

另一方面,登录到服务器并发出以下命令

Start-Process "msiexec.exe" -ArgumentList "/i \\fileserver\install\subversionclients\TortoiseSVN-1.14.0.28885-x64-svn-1.14.0.msi  /passive /norestart /qn ADDLOCAL=ALL" -Wait`

...这样可行。我无法弄清楚原因 - 没有显示错误,也没有返回值。据我了解 Invoke-command 默认情况下它是提升的。尝试添加-Verb RunAs也无济于事。我也有-wait-argument (参考https://serverfault.com/a/550169/180067),但这对我来说也没有帮助。

installation powershell remoting tortoisesvn
  • 1 个回答
  • 829 Views
Martin Hope
icnivad
Asked: 2010-03-26 14:27:25 +0800 CST

Powershell Remoting:如何在具有单独参数的多台机器上运行命令?

  • 2

例如:

假设我有 10 台服务器(服务器 1-Server10)和一个 csv 列表,其中我有服务器名称和每个服务器的单独文件夹名称/路径。

我将如何在每台机器上创建这些文件夹?

a) 打开所有 10 个连接并运行基于 csv 的命令?b) 单步执行 1by1

请指点我最有效的方法

powershell remoting
  • 3 个回答
  • 3893 Views
Martin Hope
icnivad
Asked: 2010-03-23 05:52:00 +0800 CST

Powershell Remoting:在两台目标服务器上执行本地功能

  • 1

我的本地机器上有一个函数 foo 。(在我的配置文件中,但调用 c:\scripts\foo.ps1 也可以!)我如何在 ServerA 和 ServerB 上加载它,以便我可以在下一条语句中执行该函数?

这是我尝试但没有成功..

$serverlist = 
"192.168.20.1",
"192.168.20.12"  
foreach ($item in $serverlist) {
    New-PSSession -ComputerName "$item" -Credential $cred -Name  ($item + "_session")
    Invoke-Command -ComputerName $item -Credential $cred -filepath scripts:\foo.ps1 
    Invoke-Command -ComputerName $item -Credential $cred -scriptblock {foo}  
}
powershell remoting
  • 1 个回答
  • 275 Views
Martin Hope
Electrons_Ahoy
Asked: 2009-05-16 14:46:33 +0800 CST

psexec:“访问被拒绝”?

  • 10

受我之前的问题的启发,我一直在尝试使用 PSExec。

目标是从另一台 WindowsXP 机器上分离一些相当简单的脚本/程序,并且由于 PowerShell 2 还没有在 XP 上进行远程处理,PSexec 似乎可以很好地解决我的问题。

但是,除了“访问被拒绝”错误之外,我什么也得不到。

这是我到目前为止所尝试的:

我有一对 WindowsXP MCE 机器,在没有服务器或域控制器的工作组中联网在一起。

我在两台机器上都关闭了“简单文件共享”。

在安全策略下,本地帐户的网络访问:共享和安全模型设置为经典,而不是两台机器的访客。

我知道密码的每台计算机都有一个管理用户。:)

尽管如此,像“ > psexec \\otherComputer -u adminUser cmd”这样的命令会提示输入密码(就像它应该的那样),然后退出:

Couldn't access otherComputer:
Access is denied.

所以,在这一点上,我转向社区。我在这里缺少什么步骤?

windows pstools remoting
  • 10 个回答
  • 88347 Views
Martin Hope
Electrons_Ahoy
Asked: 2009-05-15 14:12:07 +0800 CST

有没有办法让 PowerShell 2 的远程处理功能在 Windows XP 机器之间工作?

  • 4

PowerShell 2.0有一些超级时髦的远程处理功能。但是,我不清楚它们是否可以在 Windows XP 机器之间工作,或者你是否需要 Windows Vista 或 Windows 7。

这是我所拥有的:

  • 一对安装了 SP3 和.NET 3.5 的 Windows XP MCE 机器。

  • 两者都安装了 PowerShell 2.0 CTP3。

  • 两者都安装了 WS-Management v1.1(因为 2.0 似乎不适用于 Windows XP?)

有了所有这些,“Enable-PSRemoting”仍然给我带来了这个错误:

Enable-PSSessionConfiguration :此计算机上未启用或不支持 Windows PowerShell 远程处理功能。这可能是因为您没有安装正确版本的 WS-Management,或者此版本的 Windows 当前不支持远程处理。

通常,我此时的反应是“好吧,我想是时候下载 Windows 7 RC”了,但我已经看到了很多关于人们远程进出 Windows XP 的模糊评论,这让我认为这是可能的.

我怎样才能让它工作?

windows windows-xp powershell remoting
  • 5 个回答
  • 2511 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve