WINRM Enter-Pssession이 새 컴퓨터에서 작동하지 않습니다.

WINRM Enter-Pssession이 새 컴퓨터에서 작동하지 않습니다.

새 컴퓨터의 혼합 도메인 모드에서 win rm을 활성화하려고 합니다.

다른 워크스테이션에서 다음 명령을 사용하여 연결할 수 있습니다.

Enter-PSSession -ComputerName 89.251.114.100 -자격 증명 $mycred

새 컴퓨터에서 Enable-PSremoting을 실행했지만 다음 명령을 실행하면 다음과 같은 결과가 나타납니다.

Enter-PSSession : Connecting to remote server failed with the following error message : Access is denied. For more info rmation, see the about_Remote_Troubleshooting Help topic. At C:\Users\Dev1\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:93 char:17 + Enter-PSSession <<<< -ComputerName 89.251.114.100 -Credential $mycred + CategoryInfo : InvalidArgument: (00.000.000.000:String) [Enter-PSSession], PSRemotingTransportException + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

나를 이상하게 생각하는 것은 InvalidArgument입니다.

흥미롭게도 다음을 사용하여 원격 명령을 실행할 수 있습니다.

powershell.exe -ExecutionPolicy 무제한 C:\root\deploy.ps1 -inputformat 없음

답변1

PSCredential 개체의 사용자 계정이 대상 컴퓨터의 관리자 그룹에 속합니까?

winrm quickconfig관리자 권한 명령 프롬프트에서 새 컴퓨터를 실행했습니까 ? winrm 서비스를 시작하고 해당 방화벽 예외가 있는 tcp 포트 5985에 winrm 수신기를 만들어야 합니다. 그런 다음 실행을 시도하여 winrs -r:http://<targetmachine>:5985 -u:<targetmachine>\<administrator account> "dir c:\"C:의 내용이 출력되는지 확인할 수 있습니다. 이는 winrm이 올바르게 작동하고 있음을 보여줍니다.

그런 다음 대상 시스템에서 Enable-PSRemoting을 다시 실행해 보십시오(다시 관리자 권한 Powershell 프롬프트에서).

관련 정보