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

Mac OS X – Get Network Information

Posted on February 27, 2017May 2, 2017

Every once in a while you need to get some basic network information from your Mac or a Mac you are supporting, this script below will help get you some helpful information. #!/bin/sh clear sExternalMACALService="http://dns.kittell.net/macaltext.php?address=" # List all Network ports NetworkPorts=$(ifconfig -uv | grep ‘^[a-z0-9]’ | awk -F : ‘{print…

Read More

PowerShell – Disable Auto Run In Windows

Posted on April 8, 2016April 8, 2016

function Disable-AutoRun { $item = Get-Item ` "REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping\AutoRun.inf" ` -ErrorAction SilentlyContinue if (-not $item) { $item = New-Item "REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping\AutoRun.inf" } Set-ItemProperty $item.PSPath "(default)" "@SYS:DoesNotExist" } function Enable-AutoRun { Remove-Item "REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping\AutoRun.inf" -Force } Disable-AutoRun # Enable-AutoRun $path =’HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer’ Set-ItemProperty $path -Name NoDriveTypeAutorun -Type DWord -Value 0xFF Reference: http://stackoverflow.com/questions/14564380/how-to-disable-autorun-for-all-drives…

Read More

Remove Directory

Posted on October 12, 2015October 12, 2015

rd c:\temp\directorytoremove Now if this first command doesn’t work make sure it’s a directory you want to delete and try this next one rd /s c:\temp\directorytoremove 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)…

Read More

Code

Top Posts & Pages

  • Front Page
  • PowerShell - Rename Pictures to Image Taken
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - Get Text Encoding Type
  • TeamCity - Mac Agent Install

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
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - Get Text Encoding Type
  • TeamCity - Mac Agent Install
  • PowerShell - UNIX SED Equivalent - Change Text In File
  • Bleaching Wool using Hydrogen Peroxide
©2025 David Kittell | WordPress Theme by SuperbThemes
David Kittell
  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support