Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

PowerShell – List Sites with App Pool

Posted on November 10, 2015February 12, 2016 By David Kittell
Import-Module WebAdministration
 
clear 
 
$sites = @{Expression={$_.Name};Label="Site Name"}, ` @{Expression={$_.applicationPool};Label="Site App Pool";}, ` @{Expression={$_.PhysicalPath};Label="Site Physical Path";}
 
dir IIS:\Sites | Format-Table $sites -AutoSize
 
# List File Path for web.config files
ForEach($item in (dir IIS:\Sites))
{
    write-host $item.Name
    $filePath = $item.PhysicalPath
    $fileName = "web.config"
    Get-ChildItem -Recurse -Force $filePath -ErrorAction SilentlyContinue | Where-Object { ( $_.Name -like "*$fileName*") } | Select-Object FullName | format-Table * -AutoSize -HideTableHeaders
}

GitHub: https://gist.github.com/dkittell/90b53d1136d80f1c53c0

Originally Posted on November 10, 2015
Last Updated on February 12, 2016
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code PowerShell

Post navigation

Previous post
Next post

Related Posts

Get Latest SQL Query for Sessions

Posted on April 29, 2013October 26, 2015

SELECT session_id ,TEXT FROM sys.dm_exec_connections CROSS APPLY sys.dm_exec_sql_text(most_recent_sql_handle) AS ST Reference: http://blog.sqlauthority.com/2010/05/05/sql-server-get-latest-sql-query-for-sessions-dmv/ Originally Posted on April 29, 2013Last Updated on October 26, 2015 All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is…

Read More

PowerShell – Clean Windows 10

Posted on March 9, 2016April 2, 2022

Work In Progress This will remove some of the default apps along with a couple other fun features to come. clear # Many of the below items are from #https://tweakhound.com/2015/12/09/tweaking-windows-10/ #cd ~\Desktop #mkdir "God Mode.{ED7BA470-8E54-465E-825C-99712043E01C}" function Change-Service ($servicename, $serviceaction, $servicestatuptype) { if (Get-Service $servicename -ErrorAction SilentlyContinue) { $ServiceDetail=$(Get-Service -Displayname $servicename)…

Read More

Delphix Web API – PowerShell Run Masking Job

Posted on April 19, 2018

Take note of the Global Variables $BaseURL and $LogFilePath, make sure you set them to your values. The idea for this script is to run this as part of a database restore/migration. Drop all access to the database to do the restore/migration, then run the script for Delphix, and then…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes