//enable run script in PowerShell Set-ExecutionPolicy RemoteSigned //import module Import-Module WebAdministration //create a application pool New-WebAppPool testpool Set-ItemProperty iis:\AppPools\testpool -name processModel -value @{username="administrator";password="password";identitytype=3} Set-ItemProperty iis:\AppPools\testpool -name managedRuntimeVersion -value v4.0 //create a web site New-Item iis:\sites\testSite -physicalpath "C:\Users\WebSite" -bindings @{protocol="http";bindingInformation=":8083:"} -ApplicationPool testPool $website = get-item iis:\sites\testSite $website.virtualDirectoryDefaults.userName="administrator" $website.virtualDirectoryDefaults.password="password" $website | set-item
Tuesday, October 18, 2011
PowerShell: Script to Create a Website
Labels:
PowerShell
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment