Enable ISAPI and CGI Restrictions for Web Console installation using PowerShell DSC


This week I’m trying to install System Center Operations Manager 2012 R2 using PowerShell Desired State Configuration. I’ve been able to install the Domain Controller and SQL 2012 using DSC but now I was stuck at some of the pre-requisites for the OM2012 R2 installation.

clip_image002

I had to add and enable the ISAPI and CGI Restrictions for the successful installation of the Web Console.

To solve this issue I used the following DSC Script Resource.

# --------------------------------------------------- # Script: C:\Scripts\PS\OM2012R2Scripts\DSC\5_enableISAPConfig.ps1 # Version: 0.1 # Author: Stefan Stranger # Date: 11/20/2014 10:38:34 # Description: DSC Resource script to add and enable ISAP and CGI for OM12R2 Web Console installation # Comments: Initial version # Changes: # Disclaimer: # This example is provided “AS IS” with no warranty expressed or implied. Run at your own risk. # **Always test in your lab first** Do this at your own risk!! # The author will not be held responsible for any damage you incur when making these changes! # --------------------------------------------------- Configuration EnableIsapiRestriction { Node OM12R2DSC-OM { Script EnableIsapiRestriction { GetScript = { GetScript = $GetScript SetScript = $SetScript TestScript = $TestScript $frameworkPath = "$env:windir\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" Result = get-webconfiguration "/system.webServer/security/isapiCgiRestriction/add[@path='$frameworkPath']/@allowed" } SetScript = { $frameworkPath = "$env:windir\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" Add-WebConfiguration -pspath 'MACHINE/WEBROOT/APPHOST' -filter 'system.webServer/security/isapiCgiRestriction' -value @{ description = 'ASP.NET v4.0.30319' path = $frameworkPath allowed = 'True' } Set-WebConfiguration "/system.webServer/security/isapiCgiRestriction/add[@path='$frameworkPath']/@allowed" -value 'True' -PSPath:IIS:\ } TestScript = { $frameworkPath = "$env:windir\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" $isapiConfiguration = Get-WebConfiguration "/system.webServer/security/isapiCgiRestriction/add[@path='$frameworkPath']/@allowed" ($isapiConfiguration.value -ne $null) } } } } # Compile MOF EnableIsapiRestriction -OutputPath "$Env:Temp\EnableIsapiRestriction" # Make it so! Start-DscConfiguration -Path "$Env:Temp\EnableIsapiRestriction" -Wait -Verbose -Force -ErrorAction Continue

 

When running above script ISAP and CGI extensions will be added and enabled.

image

And the pre-reqs for the web console  are now met.

image

Let’s continue with the installation of OM12R2 using the xSCOM Resource Package.

Comments (0)

Skip to main content