Skip to content

Instantly share code, notes, and snippets.

@jeffpatton1971
Created December 30, 2013 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffpatton1971/8188439 to your computer and use it in GitHub Desktop.
Save jeffpatton1971/8188439 to your computer and use it in GitHub Desktop.
$SourcePath = "$($pshome)\modules\psdesiredstateconfiguration\pullserver"
$DestinationPath = "C:\inetpub\wwwroot\PSDSCPullServer"
$AppPool = "DSCAppPool"
New-Item C:\inetpub\wwwroot\PSDSCPullServer\bin -ItemType directory -Force
Copy-Item "$($SourcePath)\psdscpullserver.*" $DestinationPath
Copy-Item "$($SourcePath)\Global.asax" $DestinationPath
Copy-Item "$($SourcePath)\Microsoft.Powershell.DesiredStateConfiguration.Service.dll" "$($DestinationPath)\bin"
Rename-Item "$($DestinationPath)\psdscpullserver.config" "$($DestinationPath)\web.config"
Copy-Item "$($SourcePath)\Devices.mdb" "$($env:programfiles)\WindowsPowerShell\DscService"
New-WebAppPool -Name $AppPool
New-Website -Name "DSC-Service" -Port 8080 -PhysicalPath $DestinationPath -ApplicationPool $AppPool
$appcmd = "$env:windir\system32\inetsrv\appcmd.exe"
& $appCmd unlock config -section:access
& $appCmd unlock config -section:anonymousAuthentication
& $appCmd unlock config -section:basicAuthentication
& $appCmd unlock config -section:windowsAuthentication
@jeffpatton1971
Copy link
Author

This should run after you run the adddcsservice.ps1 (https://gist.github.com/jeffpatton1971/8187784)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment