

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get the default Documents from the IIS site using PowerShell?
To get the default documents stored on the IIS default website page, you can use the below command.
Example
Get-WebConfigurationProperty -Filter //defaultDocument/files/add -PSPath 'IIS:\Sites\Default Web Site' -Name value ` | select value
Output
Value ----- Default.htm Default.asp index.htm index.html iisstart.htm
To check if the Default document contains a specific file,
(Get-WebConfigurationProperty -Filter //defaultDocument/files/add -PSPath 'IIS:\Sites\Default Web Site' -Name value).value -contains 'iisstart.htm'
The above command checks if the IIS default website contains any iisstart.htm on the default document page.
You can also use another website instead of using 'Default Web site'. To get the default documents file at the IIS level,
(Get-WebConfigurationProperty -Filter //defaultDocument/files/add -PSPath 'IIS:\' -Name value).value
- Related Questions & Answers
- How to get the IIS Application Pool names using PowerShell?
- How to get the IIS Application Pool queue length using PowerShell?
- How to get the IIS Application Pool failure Settings using PowerShell?
- How to get the IIS Application Pool Recycle settings using PowerShell?
- How to get the azure resources from the resource group using PowerShell?
- How to get the Azure images available from the specific publisher using PowerShell?
- How to get the disk performance using PowerShell?
- How to get the disk information using PowerShell?
- How to get the folder size using PowerShell?
- How to get the file extension using PowerShell?
- How to get all the Get-Process properties using PowerShell?
- How to get the system files using the Get-ChildItem in PowerShell?
- How to get/resolve the command from the alias in PowerShell?
- How to get the windows performance counter using PowerShell?
- How to get the Process performance counter using PowerShell?
Advertisements