로컬에서 powershell을 사용하여 원격 서버에 연결하는 방법. Enter-PSSession이 작동하지 않음(관련 Exchange 서비스 아님)

로컬에서 powershell을 사용하여 원격 서버에 연결하는 방법. Enter-PSSession이 작동하지 않음(관련 Exchange 서비스 아님)

로컬 Powershell 세션을 사용하여 원격 컴퓨터에 연결하려고 합니다.

이를 위해 로컬 powershell Enter-PSSession 또는 New-PSSession comandlet을 다음과 같이 사용하려고 합니다.

$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#을 사용하여 실행 공간을 열고 원격 서버 powerSell URL로 WSManConnectionInfo 개체를 제공하는 동안 이와 동일한 예외가 발생합니다.

이미 winrm 명령에 관해 모든 방법을 다 수행했지만 실제로 문제가 해결되지는 않습니다. 이 문제를 제거하는 방법은 무엇입니까?

답변1

왜 간단하지 않습니까 Enter-PSSession apdv0710.forest7.dom?

먼저 apdv0710.forest7.dom에서 실행해야 합니다 Enable-PSRemoting.

답변2

이는 사용자 이름과 비밀번호가 포함된 자격 증명 개체 외에 인증 메커니즘으로 컴퓨터 이름, Kerberos만 제공함으로써 저에게 효과적이었습니다.

New-PSSession -Authentication Kerberos -Computer 'apdv004s' -Cred $credential 

에 대한 동일한 사용법 Enter-PSSession.

관련 정보