Skip to content

Instantly share code, notes, and snippets.

@echohack
Last active October 7, 2015 20:33
Show Gist options
  • Save echohack/957aa29b493e1b7b8967 to your computer and use it in GitHub Desktop.
Save echohack/957aa29b493e1b7b8967 to your computer and use it in GitHub Desktop.
iis_ws_config
configuration iis_ws_config
{
Import-DscResource -Module xWebAdministration
xWebsite DefaultWebSite
{
Name = "<%= @site_name %>"
Ensure = "Present"
PhysicalPath = "<%= @site_path %>"
State = "Started"
}
xWebAppPool app
{
Name = "app"
Ensure = "Present"
State = "Started"
}
Script AppPoolIdentity
{
TestScript = {
Import-Module WebAdministration
return (Get-Item IIS:\AppPools\app).processModel.username -eq "<%= @ws_pool_user %>"
}
SetScript = {
Import-Module WebAdministration
$pool = get-item IIS:\AppPools\app
$pool.processModel.username = "<%= @ws_pool_user %>"
$pool.processModel.password = "<%= @ws_pool_pswd %>"
$pool.processModel.identityType = 3
$pool | set-item
}
GetScript = {
Import-Module WebAdministration
$pool = Get-Item IIS:\AppPools\app
return @{
ProcessModel = $pool.processModel
}
}
}
xWebApplication formservice
{
Name = "formservice"
Website = "<%= @site_name %>"
WebAppPool = "app"
Ensure = "Present"
PhysicalPath = "<%= @formservice_path %>"
}
xWebApplication formsetservice
{
Name = "formsetservice"
Website = "<%= @site_name %>"
WebAppPool = "app"
Ensure = "Present"
PhysicalPath = "<%= @formsetservice_path %>"
}
xWebApplication renderingservice
{
Name = "renderingservice"
Website = "<%= @site_name %>"
WebAppPool = "app"
Ensure = "Present"
PhysicalPath = "<%= @renderingservice_path %>"
}
xWebApplication services
{
Name = "services"
Website = "<%= @site_name %>"
WebAppPool = "app"
Ensure = "Present"
PhysicalPath = "<%= @services_path %>"
}
xWebApplication servicesV2
{
Name = "services/v2"
Website = "<%= @site_name %>"
WebAppPool = "app"
Ensure = "Present"
PhysicalPath = "<%= @services_path %>\v2"
}
xWebApplication servicesV3
{
Name = "services/v3"
Website = "<%= @site_name %>"
WebAppPool = "eForms"
Ensure = "Present"
PhysicalPath = "<%= @services_path %>\v3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment