Home > Blockchain >  Get IIS apps using powershell
Get IIS apps using powershell

Time:10-13

Please advice how to get the list of my IIS applications(it's names) using PowerShell script.

enter image description here

If I run Get-IISSite

the result is enter image description here

But I need all applications that is inside Default Web Site section.

Like to go through some foreach and retrieve all apps names that exists inside Default Web Site.

CodePudding user response:

You can try the following PowerShell script:

(get-webapplication -Site "Default Web Site" | select-object @{n='Site'; e= {$_.GetParentElement().Attributes['name'].value   $_.path }},@{n='Location'; e= {$_.PhysicalPath}})

Below is the result of my test:

image1

image2

If you only want to get all applications name of the Default Web Site, you can write a powershell script like this:

(Get-ChildItem -Path 'IIS:\Sites\Default Web Site' | Where-Object {$_.NodeType -eq 'application'}).Name

image3

  • Related