Archive for June, 2013

This is something I’ve done recently, i.e. to create IIS applications via Powershell scripting.

# Run this powerscript as an administrator (needed for IIS stuff)

# Create folders for the web site

$drive = “c:\”

“Creating folders…”

# home folder
$myhome = $drive + “mysite\”
new-item $myhome -itemtype directory

# log folders
new-item ($myhome + “Log”) -itemtype directory
new-item ($myhome + “Log\WebLog”) -itemtype directory

# web folders
new-item ($myhome + “www”) -itemtype directory
new-item ($myhome + “www\client”) -itemtype directory

# IIS stuff

# Load IIS module, to be able to do IIS stuff
import-module webadministration

# Set webadministration as default for all commands

# Creating app pool, with some properties
$appPoolName = “myAppPool”
new-item (“AppPools\” + $appPoolName)
Set-ItemProperty (“AppPools\” + $appPoolName) -Name recycling.periodicRestart.requests -Value 1000
Set-ItemProperty (“AppPools\” + $appPoolName) managedRuntimeVersion v4.0
Set-ItemProperty (“AppPools\” + $appPoolName) enable32BitAppOnWin64 “true”

# Create the webapp & site
$homedir = $drive + “mysite\www\”
$hostname = “www.myhostname.com”
$sitename = “MySiteName”
$appname = “www.myhostname.com”
New-Item (“\Sites\” + $sitename) -bindings @{protocol=”http”;bindingInformation=(“:80:” + $hostname)} -physicalPath $homedir
Set-ItemProperty (“\sites\” + $sitename) -name applicationPool -value $appPoolName
New-Item (“\Sites\” + $sitename + “\client”) -type Application -physicalPath ($homedir + “client”) -force

# Change Logging
Set-ItemProperty (“\Sites\” + $sitename) -name logFile.directory -value ($drive + $sitename + “\Log\WebLog”)



Read Full Post »

I got this tip from a friend, i.e. to disable ping in the identity pool to avoid timeouts during debugging of web applications: http://www.shubho.net/2011/02/debugging-timeout-visual-studio-iis7.html. Thanks a lot Per!

Read Full Post »