Last active
July 15, 2020 12:24
-
-
Save mikerodionov/7d23e524954f8777904e61b91f9f6206 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Set Execution Policy if necessary using command below | |
#Set-ExecutionPolicy Unrestricted -Force | |
#-------------------------------- | |
#Modules | |
# | |
Import-Module WebAdministration | |
#-------------------------------- | |
#Variables | |
# | |
$DrivePath = "C:\inetpub\K2" | |
# K2 workspace site settings | |
$K2WebAppPoolName = "K2" | |
$K2WebSiteName = "K2" | |
$K2WebHostHeader = ":443:K2.denallix.com" | |
#-------------------------------- | |
#Script | |
# | |
#Create directory for IIS web site | |
New-Item -type directory -path $DrivePath | |
#K2 Web site settings | |
#Create application pool, K2 installer will set the service account | |
New-Item IIS:\AppPools\$K2WebAppPoolName | |
Set-ItemProperty IIS:\AppPools\$K2WebAppPoolName 'managedPipelineMode' "Classic" | |
#Create IIS site, set the binding, enable windows auth and disable anon | |
New-Item IIS:\Sites\$K2WebSiteName -bindings @{protocol='http';bindingInformation=$K2WebHostHeader} -PhysicalPath $DrivePath | |
Set-ItemProperty IIS:\Sites\$K2WebSiteName -name applicationPool -value $K2WebSiteName | |
Set-WebConfigurationProperty -filter /system.WebServer/security/authentication/AnonymousAuthentication -name enabled -value false -location $K2WebSiteName | |
Set-WebConfigurationProperty -filter /system.WebServer/security/authentication/WindowsAuthentication -name enabled -value true -location $K2WebSiteName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment