
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
Get Default Documents from 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
Advertisements