Configure ConfigMgr Pre-Reqs with Powershell

Something you have to get right, and getting it right first time if preferrable, when installing your SCCM Site Servers is to configure IIS, BITS and WebDav Publishing.
This simple Powershell script takes care of these pre-requisite configurations: (You can also create a package and deploy as part of a standalone media set if you want to fully automate your build)

Script body follows: (copy following text into notepad and saveas .ps1)

#————————————————————————–

# add Server Manager CMDLETS
Import-Module servermanager

# add Windows Features Required for SCCM Site Server
Add-WindowsFeature WAS-Process-Model
Add-WindowsFeature WAS-Config-APIs
Add-WindowsFeature Web-Server
Add-WindowsFeature Web-ISAPI-Ext
Add-WindowsFeature Web-ISAPI-Filters
Add-WindowsFeature Web-Net-Ext
Add-WindowsFeature Web-Net-Environment
Add-WindowsFeature Web-ASP-Net
Add-WindowsFeature Web-ASP
Add-WindowsFeature Web-Windows-Auth
Add-WindowsFeature Web-Stat-Compression
Add-WindowsFeature Web-Metabase
Add-WindowsFeature Web-WMI
Add-WindowsFeature Web-HTTP-Redirect
Add-WindowsFeature Web-Log-Libraries
Add-WindowsFeature Web-HTTP-Tracing
Add-WindowsFeature BITS-IIS-Ext
Add-WindowsFeature Net-Framework-Core
Add-WindowsFeature RDC
Add-WindowsFeature Web-Dav-Publishing

# enable WebDav
“C:\windows\System32\inetsrv\appcmd.exe set config “”Default Web Site”” /section:system.webserver/webdav/authoring /enabled:true /commit:apphost”
# add Authoring Rule WebDav
“c:\windows\system32\inetsrv\appcmd.exe set config “”Default Web Site/”” /section:system.webServer/webdav/authoringRules /””+[users=’*’,path=’*’,access=’Read’]”” /commit:apphost” | Invoke-Expression
# allow Hidden Files WebDav
“c:\windows\system32\inetsrv\appcmd.exe set config “”Default Web Site/”” /section:system.webServer/webdav/authoring /fileSystem.allowHiddenFiles:true /commit:apphost” | Invoke-Expression
# allow Anonymous Property Find WebDav
“c:\windows\system32\inetsrv\appcmd.exe set config “”Default Web Site/”” /section:system.webServer/webdav/authoring /properties.allowAnonymousPropfind:true /commit:apphost” | Invoke-Expression
# DON’T allow Custom Properties WebDav
“c:\windows\system32\inetsrv\appcmd.exe set config “”Default Web Site/”” /section:system.webServer/webdav/authoring /properties.allowCustomProperties:false /commit:apphost” | Invoke-Expression
# allow Infinite Property Depth Find WebDav
“c:\windows\system32\inetsrv\appcmd.exe set config “”Default Web Site/”” /section:system.webServer/webdav/authoring /properties.allowInfinitePropfindDepth:true /commit:apphost” | Invoke-Expression
# DON’T allow Hidden Segment Filtering WebDav
“c:\windows\system32\inetsrv\appcmd.exe set config “”Default Web Site/”” /section:system.webServer/security/requestFiltering /hiddenSegments.applyToWebDAV:false /commit:apphost” | Invoke-Expression

#————————————————————————–

I used Invoke-Expression with appcmd.exe because I as yet have not developed the pure Powershell.

Hope this helps

Andy

Advertisement

5 thoughts on “Configure ConfigMgr Pre-Reqs with Powershell

  1. Nash February 17, 2011 / 8:45 pm

    Now if only MSFT would provide one of these with each of their configuration checklists… Nice.

  2. Sam Erskine May 18, 2011 / 8:51 am

    Excellent Script.
    I setup a demo SCCM site and applied the Webdav settings manually (but not on the default website). The MP didnt install even after correcting.
    I run the script and it skips over settings already in place and corrected missing properties. Saved me a lot of work (In the past I would have reinstalled).

    Thanks Andy

  3. Howard Carter June 2, 2011 / 8:06 pm

    Andrew,

    This script is fantastic! It’s cut hours off my deployments (100’s of servers).

    -Howard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s