2017-12-20 31 views
0

Windows 2016에서 WebAdministration이 아닌 Powershell 용 새 IISAdministration 모듈을 사용하려고 시도하면 특정 웹 사이트에 대해 Require Ssl 확인란을 어떻게 설정합니까? ? IIS 관리자를 사용하여 때 체크 박스 값이 저장된다 C:\Windows\System32\inetsrv\config\applicationHost.config에서 발견 system.webserver/security/access에 대한설정 방법 Windows에서 Powershell IIS 관리 모듈을 사용하여 IIS 웹 사이트에 SSL 필요 2016

참조, SSL의 특정 웹 사이트에 대한 설정 : 후손에 대한 내 자신의 질문에 대답

<location path="MySite"> 
    <system.webServer> 
     <security> 
      <access sslFlags="Ssl" /> 
     </security> 
    </system.webServer> 
</location> 

답변

0

.

IISAdministration의 New-IISSiteBinding cmdlet이 정말 혼란 스럽습니다.

  1. 이 내 기본 Windows 2016 (AN AWS ​​이미지에서로드)의 일부가 아니 었 시작하려면, 그래서 내가 먼저 Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force 다음 Install-Module -Name IISAdministration -Force을 수행하여 IISAdministration 1.1로 업데이트했다. IISAdministration 1.0 NuGet으로 설치되지 않은 것처럼 그것이 승리 2016

  2. 두 번째의 일부, 업데이트 모듈을 사용할 수 없습니다,이에 SslFlag 속성은 Require Ssl에 대한 SslFlags와는 아무 상관이 없습니다. (New-IISSiteBinding)은 None, Sni, CentralCertStore으로 설정할 수 있습니다. IIS 관리자에서 웹 사이트를 클릭 한 다음 오른쪽에 바인딩 링크를 추가 한 다음 추가/편집을 클릭하고 "서버 이름 표시 필요"확인란을 선택하는 것과 같습니다.

IISAdministration cmdlet Get-IISConfigSection입니다. 이 너무 파이프 할 수

Import-Module IISAdministration 
$ConfigSection = Get-IISConfigSection -SectionPath "system.webServer/security/access" -Location "MyWebSite" 
#to set: 
Set-IISConfigAttributeValue -AttributeName sslFlags -AttributeValue Ssl -ConfigElement $ConfigSection 
#to read: 
Get-IISConfigAttributeValue -ConfigElement $ConfigSection -AttributeName sslFlags 

: 다음 코드는 웹 사이트에 Require Ssl를 설정합니다 (다음, 웹 사이트에 SSL 설정 아이콘을 클릭에 IIS 관리자에서 해당 체크 상자 "SSL 필요"). 이 sslFlags의 가능한 값은 None, Ssl, SslNegotiateCert, SslRequireCert, SslMapCert, Ssl128입니다 (Access Security access 참조)