Posted in
Windows Powershell |
No Comment | 1,272 views | 21/09/2015 17:39
These are IIS Website properties that you can get using CIM via PowerShell.
1
2
3
4
5
6
7
8
9
10
| # Get WebSites
$WebSites = Get-CimInstance -Namespace "root\MicrosoftIISv2" -ClassName "IIsWebServerSetting" -OperationTimeoutSec 15 -EA Stop
$WebSite = $WebSites[0];
# WebSite Cache Information
[string]$WebSiteCacheControlCustom = $WebSite.CacheControlCustom
[string]$WebSiteCacheControlMaxAge = $WebSite.CacheControlMaxAge
[string]$WebSiteCacheControlNoCache = $WebSite.CacheControlNoCache
[string]$WebSiteCacheISAPI = $WebSite.CacheISAPI |
# Get WebSites
$WebSites = Get-CimInstance -Namespace "root\MicrosoftIISv2" -ClassName "IIsWebServerSetting" -OperationTimeoutSec 15 -EA Stop
$WebSite = $WebSites[0];
# WebSite Cache Information
[string]$WebSiteCacheControlCustom = $WebSite.CacheControlCustom
[string]$WebSiteCacheControlMaxAge = $WebSite.CacheControlMaxAge
[string]$WebSiteCacheControlNoCache = $WebSite.CacheControlNoCache
[string]$WebSiteCacheISAPI = $WebSite.CacheISAPI
You can find more properties in my blog.