PowerShell을 사용하여 인증서를 설치하려고합니다. 내 컴퓨터에서 원격 세션을 만들어 설치를 테스트하고 있습니다. 원격 세션 외부에서 인증서를 성공적으로 설치 했으므로 명령이 정확하다는 것을 알고 있습니다. 나는 원격 세션없이이 명령을 실행하면PowerShell을 사용하여 원격 컴퓨터에 인증서를 설치하려면 어떻게해야합니까?
Access is denied. 0x80070005 (WIN32: 5 ERROR_ACCESS_DENIED). This may be the result of user credentials being required on the remote machine. See Enable-WSManCredSSP Cmdlet help on how to enable and use CredSSP for delegation with PowerShell remoting.
작동 : 난 내 자신의 컴퓨터에 원격 세션을 수행 할 때 나는 오류가 나타납니다
Import-PfxCertificate -FilePath "\\network\storage\site.com.pfx" -CertStoreLocation "Cert:\\LocalMachine\\WebHosting" -Password (ConvertTo-SecureString -String "foobar" -AsPlainText -Force)
내가 (Invoke-Command
통해) 명령을 실행 원격 세션에서 위에서 언급 한 오류가 발생합니다 :
$session = New-PSSession $Env:ComputerName
Invoke-Command -Session $session -ScriptBlock { Import-PfxCertificate -FilePath "\\network\storage\site.com.pfx" -CertStoreLocation "Cert:\\LocalMachine\\WebHosting" -Password (ConvertTo-SecureString -String "foobar" -AsPlainText -Force) }
이 사용 권한 문제를 해결하려면 어떻게합니까?
이 답변에 덧붙여서, 어떻게 그리고 왜 이것이 효과가 있는지 알고 싶다면 여기의 "Powershell remoting의 비밀"을 확인하십시오. https://devopscollective.gitbooks.io/secrets-of-powershell-remoting/ content/manuscript/accessible-remote-computers.html, 특히 마지막 두 섹션. – Astrotrain
응답 Paul을 보내 주셔서 감사합니다. 내가 원격 세션 (닭고기와 계란 문제 내가 추정)을 통해 해당 명령을 실행할 수없는 가정? 우리는 서버 및 응용 프로그램 설정을 완벽하게 자동화하기 위해 그룹 정책이나 다른 방법을 통해 다르게 접근해야 할 수도 있습니다. –
@JustinHelgerson은 100 % 확신 할 수 없지만 올바르게 추측하고 있다고 생각합니다.) 그룹 정책은 다음과 같은 방식으로 진행됩니다. https://msdn.microsoft.com/en-us/library/windows/desktop/bb204773(v= vs.85) .aspx – Paul