Posted in
Windows Powershell |
No Comment | 1,039 views | 27/07/2015 17:36
These are IIS Website Authentication properties that you can get using CIM via PowerShell.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| # Get WebSites
$WebSites = Get-CimInstance -Namespace "root\MicrosoftIISv2" -ClassName "IIsWebServerSetting" -OperationTimeoutSec 15 -EA Stop
$WebSite = $WebSites[0];
# WebSite Authentication Information
[string]$WebSiteAuthAdvNotifyDisable = $WebSite.AuthAdvNotifyDisable
[string]$WebSiteAuthAnonymous = $WebSite.AuthAnonymous
[string]$WebSiteAuthBasic = $WebSite.AuthBasic
[string]$WebSiteAuthChangeDisable = $WebSite.AuthChangeDisable
[string]$WebSiteAuthChangeUnsecure = $WebSite.AuthChangeUnsecure
[string]$WebSiteAuthFlags = $WebSite.AuthFlags
[string]$WebSiteAuthMD5 = $WebSite.AuthMD5
[string]$WebSiteAuthNTLM = $WebSite.AuthNTLM
[string]$WebSiteAuthPassport = $WebSite.AuthPassport
[string]$WebSiteAuthPersistence = $WebSite.AuthPersistence
[string]$WebSiteAuthPersistSingleRequest = $WebSite.AuthPersistSingleRequest |
# Get WebSites
$WebSites = Get-CimInstance -Namespace "root\MicrosoftIISv2" -ClassName "IIsWebServerSetting" -OperationTimeoutSec 15 -EA Stop
$WebSite = $WebSites[0];
# WebSite Authentication Information
[string]$WebSiteAuthAdvNotifyDisable = $WebSite.AuthAdvNotifyDisable
[string]$WebSiteAuthAnonymous = $WebSite.AuthAnonymous
[string]$WebSiteAuthBasic = $WebSite.AuthBasic
[string]$WebSiteAuthChangeDisable = $WebSite.AuthChangeDisable
[string]$WebSiteAuthChangeUnsecure = $WebSite.AuthChangeUnsecure
[string]$WebSiteAuthFlags = $WebSite.AuthFlags
[string]$WebSiteAuthMD5 = $WebSite.AuthMD5
[string]$WebSiteAuthNTLM = $WebSite.AuthNTLM
[string]$WebSiteAuthPassport = $WebSite.AuthPassport
[string]$WebSiteAuthPersistence = $WebSite.AuthPersistence
[string]$WebSiteAuthPersistSingleRequest = $WebSite.AuthPersistSingleRequest
You can find more properties in my blog.