Geeks With Blogs
Sean Rhone

Posting these so I can find them easily in the future when I need them

-- Selects the default documents from the applicationHost.config
Get-WebConfigurationProperty -Filter 'system.webServer/defaultDocument/files/add' -PSPath 'Machine/WebRoot/AppHost' -Name value

-- Changes the value of the file name in the defaultDocument list in the applicationHost.config
Set-WebConfigurationProperty 'system.webServer/defaultDocument/files/add[@value="default.aspx"]' -PSPath 'Machine/WebRoot/AppHost' -Name value -Value "NewName.aspx"

-- Removes document from defaultDocuments list in applicationHost.config
Remove-WebConfigurationProperty system.webServer/defaultDocument -Name files -AtElement @{value="default.aspx"}

-- Gets all web applications running under the Default Web Site
Get-WebApplication -Site "Default Web Site"

-- Deletes web application under Default Web Site
Remove-WebApplication -Site "Default Web Site" -Name "/ApplicationName"

-- Deletes AppPool
Remove-WebAppPool -Name "AppPoolName"

Posted on Monday, January 4, 2016 3:00 PM IIS , PowerShell | Back to top

Comments on this post: Powershell & IIS

# re: Powershell & IIS
Requesting Gravatar...
Brilliant idea! This information is very useful to me now. - Steve Wyer
Left by Lindsay Miller on Aug 08, 2016 11:50 PM

Your comment:
 (will show your gravatar)

Copyright © Sean Rhone | Powered by: