Get all website entries in IIS

It's very easy to get the list of the website entries in IIS with 3 lines of code.


  Import-Module WebAdministration
  cd IIS:\Sites
  Get-ChildItem | select name

Explanation:

1. We need to import the WebAdministration PS module. This module includes all the necessary API for Powershell to interact with IIS.

2. The second line is to change the current location to IIS Sites folder.

3. Finally, get all the items in the current location.

Comments

Popular posts from this blog

Scheduled task in Windows Task Scheduler - part 3

Create scheduled task in Windows Task Scheduler