Posted in Windows Powershell | No Comment | 1,244 views | 28/08/2015 17:34
These are IIS Website 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
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
| # Get WebSites
$WebSites = Get-CimInstance -Namespace "root\MicrosoftIISv2" -ClassName "IIsWebServerSetting" -OperationTimeoutSec 15 -EA Stop
$WebSite = $WebSites[0];
# WebSite ASP Information
[string]$WebSiteAspAllowOutOfProcComponents = $WebSite.AspAllowOutOfProcComponents
[string]$WebSiteAspAllowSessionState = $WebSite.AspAllowSessionState
[string]$WebSiteAspAppServiceFlags = $WebSite.AspAppServiceFlags
[string]$WebSiteAspBufferingLimit = $WebSite.AspBufferingLimit
[string]$WebSiteAspBufferingOn = $WebSite.AspBufferingOn
[string]$WebSiteAspCalcLineNumber = $WebSite.AspCalcLineNumber
[string]$WebSiteAspCodepage = $WebSite.AspCodepage
[string]$WebSiteAspDiskTemplateCacheDirectory = $WebSite.AspDiskTemplateCacheDirectory
[string]$WebSiteAspEnableApplicationRestart = $WebSite.AspEnableApplicationRestart
[string]$WebSiteAspEnableAspHtmlFallback = $WebSite.AspEnableAspHtmlFallback
[string]$WebSiteAspEnableChunkedEncoding = $WebSite.AspEnableChunkedEncoding
[string]$WebSiteAspEnableParentPaths = $WebSite.AspEnableParentPaths
[string]$WebSiteAspEnableSxs = $WebSite.AspEnableSxs
[string]$WebSiteAspEnableTracker = $WebSite.AspEnableTracker
[string]$WebSiteAspEnableTypelibCache = $WebSite.AspEnableTypelibCache
[string]$WebSiteAspErrorsToNTLog = $WebSite.AspErrorsToNTLog
[string]$WebSiteAspExceptionCatchEnable = $WebSite.AspExceptionCatchEnable
[string]$WebSiteAspExecuteInMTA = $WebSite.AspExecuteInMTA
[string]$WebSiteAspKeepSessionIDSecure = $WebSite.AspKeepSessionIDSecure
[string]$WebSiteAspLCID = $WebSite.AspLCID
[string]$WebSiteAspLogErrorRequests = $WebSite.AspLogErrorRequests
[string]$WebSiteAspMaxDiskTemplateCacheFiles = $WebSite.AspMaxDiskTemplateCacheFiles
[string]$WebSiteAspMaxRequestEntityAllowed = $WebSite.AspMaxRequestEntityAllowed
[string]$WebSiteAspPartitionID = $WebSite.AspPartitionID
[string]$WebSiteAspProcessorThreadMax = $WebSite.AspProcessorThreadMax
[string]$WebSiteAspQueueConnectionTestTime = $WebSite.AspQueueConnectionTestTime
[string]$WebSiteAspQueueTimeout = $WebSite.AspQueueTimeout
[string]$WebSiteAspRequestQueueMax = $WebSite.AspRequestQueueMax
[string]$WebSiteAspRunOnEndAnonymously = $WebSite.AspRunOnEndAnonymously
[string]$WebSiteAspScriptEngineCacheMax = $WebSite.AspScriptEngineCacheMax
[string]$WebSiteAspScriptErrorMessage = $WebSite.AspScriptErrorMessage
[string]$WebSiteAspScriptErrorSentToBrowser = $WebSite.AspScriptErrorSentToBrowser
[string]$WebSiteAspScriptFileCacheSize = $WebSite.AspScriptFileCacheSize
[string]$WebSiteAspScriptLanguage = $WebSite.AspScriptLanguage
[string]$WebSiteAspScriptTimeout = $WebSite.AspScriptTimeout
[string]$WebSiteAspSessionMax = $WebSite.AspSessionMax
[string]$WebSiteAspSessionTimeout = $WebSite.AspSessionTimeout
[string]$WebSiteAspSxsName = $WebSite.AspSxsName
[string]$WebSiteAspTrackThreadingModel = $WebSite.AspTrackThreadingModel
[string]$WebSiteAspUsePartition = $WebSite.AspUsePartition |
# Get WebSites
$WebSites = Get-CimInstance -Namespace "root\MicrosoftIISv2" -ClassName "IIsWebServerSetting" -OperationTimeoutSec 15 -EA Stop
$WebSite = $WebSites[0];
# WebSite ASP Information
[string]$WebSiteAspAllowOutOfProcComponents = $WebSite.AspAllowOutOfProcComponents
[string]$WebSiteAspAllowSessionState = $WebSite.AspAllowSessionState
[string]$WebSiteAspAppServiceFlags = $WebSite.AspAppServiceFlags
[string]$WebSiteAspBufferingLimit = $WebSite.AspBufferingLimit
[string]$WebSiteAspBufferingOn = $WebSite.AspBufferingOn
[string]$WebSiteAspCalcLineNumber = $WebSite.AspCalcLineNumber
[string]$WebSiteAspCodepage = $WebSite.AspCodepage
[string]$WebSiteAspDiskTemplateCacheDirectory = $WebSite.AspDiskTemplateCacheDirectory
[string]$WebSiteAspEnableApplicationRestart = $WebSite.AspEnableApplicationRestart
[string]$WebSiteAspEnableAspHtmlFallback = $WebSite.AspEnableAspHtmlFallback
[string]$WebSiteAspEnableChunkedEncoding = $WebSite.AspEnableChunkedEncoding
[string]$WebSiteAspEnableParentPaths = $WebSite.AspEnableParentPaths
[string]$WebSiteAspEnableSxs = $WebSite.AspEnableSxs
[string]$WebSiteAspEnableTracker = $WebSite.AspEnableTracker
[string]$WebSiteAspEnableTypelibCache = $WebSite.AspEnableTypelibCache
[string]$WebSiteAspErrorsToNTLog = $WebSite.AspErrorsToNTLog
[string]$WebSiteAspExceptionCatchEnable = $WebSite.AspExceptionCatchEnable
[string]$WebSiteAspExecuteInMTA = $WebSite.AspExecuteInMTA
[string]$WebSiteAspKeepSessionIDSecure = $WebSite.AspKeepSessionIDSecure
[string]$WebSiteAspLCID = $WebSite.AspLCID
[string]$WebSiteAspLogErrorRequests = $WebSite.AspLogErrorRequests
[string]$WebSiteAspMaxDiskTemplateCacheFiles = $WebSite.AspMaxDiskTemplateCacheFiles
[string]$WebSiteAspMaxRequestEntityAllowed = $WebSite.AspMaxRequestEntityAllowed
[string]$WebSiteAspPartitionID = $WebSite.AspPartitionID
[string]$WebSiteAspProcessorThreadMax = $WebSite.AspProcessorThreadMax
[string]$WebSiteAspQueueConnectionTestTime = $WebSite.AspQueueConnectionTestTime
[string]$WebSiteAspQueueTimeout = $WebSite.AspQueueTimeout
[string]$WebSiteAspRequestQueueMax = $WebSite.AspRequestQueueMax
[string]$WebSiteAspRunOnEndAnonymously = $WebSite.AspRunOnEndAnonymously
[string]$WebSiteAspScriptEngineCacheMax = $WebSite.AspScriptEngineCacheMax
[string]$WebSiteAspScriptErrorMessage = $WebSite.AspScriptErrorMessage
[string]$WebSiteAspScriptErrorSentToBrowser = $WebSite.AspScriptErrorSentToBrowser
[string]$WebSiteAspScriptFileCacheSize = $WebSite.AspScriptFileCacheSize
[string]$WebSiteAspScriptLanguage = $WebSite.AspScriptLanguage
[string]$WebSiteAspScriptTimeout = $WebSite.AspScriptTimeout
[string]$WebSiteAspSessionMax = $WebSite.AspSessionMax
[string]$WebSiteAspSessionTimeout = $WebSite.AspSessionTimeout
[string]$WebSiteAspSxsName = $WebSite.AspSxsName
[string]$WebSiteAspTrackThreadingModel = $WebSite.AspTrackThreadingModel
[string]$WebSiteAspUsePartition = $WebSite.AspUsePartition
You can find more properties in my blog.
Posted in Windows Powershell | No Comment | 1,514 views | 16/08/2015 17:30
These are IIS Website Directory Browsing properties that you can get using CIM via PowerShell.
1
2
3
4
5
6
7
8
9
10
11
12
| # Get WebSites
$WebSites = Get-CimInstance -Namespace "root\MicrosoftIISv2" -ClassName "IIsWebServerSetting" -OperationTimeoutSec 15 -EA Stop
$WebSite = $WebSites[0];
# WebSite Directory Browsing Information
[string]$WebSiteEnableDirBrowsing = $WebSite.EnableDirBrowsing
[string]$WebSiteDirBrowseShowDate = $WebSite.DirBrowseShowDate
[string]$WebSiteDirBrowseShowExtension = $WebSite.DirBrowseShowExtension
[string]$WebSiteDirBrowseShowLongDate = $WebSite.DirBrowseShowLongDate
[string]$WebSiteDirBrowseShowSize = $WebSite.DirBrowseShowSize
[string]$WebSiteDirBrowseShowTime = $WebSite.DirBrowseShowTime |
# Get WebSites
$WebSites = Get-CimInstance -Namespace "root\MicrosoftIISv2" -ClassName "IIsWebServerSetting" -OperationTimeoutSec 15 -EA Stop
$WebSite = $WebSites[0];
# WebSite Directory Browsing Information
[string]$WebSiteEnableDirBrowsing = $WebSite.EnableDirBrowsing
[string]$WebSiteDirBrowseShowDate = $WebSite.DirBrowseShowDate
[string]$WebSiteDirBrowseShowExtension = $WebSite.DirBrowseShowExtension
[string]$WebSiteDirBrowseShowLongDate = $WebSite.DirBrowseShowLongDate
[string]$WebSiteDirBrowseShowSize = $WebSite.DirBrowseShowSize
[string]$WebSiteDirBrowseShowTime = $WebSite.DirBrowseShowTime
You can find more properties in my blog.
Posted in Windows Powershell | No Comment | 1,113 views | 15/08/2015 17:55
These are IIS Application Pool Periodic Restart properties that you can get using CIM via PowerShell.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| # WebSite AppPool Information
$WebSiteAppPools = Get-CimInstance -Namespace "root\MicrosoftIISv2" -ClassName "IIsApplicationPoolSetting" -OperationTimeoutSec 15 -EA Stop
$WebSiteAppPool = $WebSiteAppPools[0];
# IIS AppPool Periodic Restart Information
[string]$WebSiteAppPoolPeriodicRestartMemory = $WebSiteAppPool.PeriodicRestartMemory
[string]$WebSiteAppPoolPeriodicRestartPrivateMemory = $WebSiteAppPool.PeriodicRestartPrivateMemory
[string]$WebSiteAppPoolPeriodicRestartRequests = $WebSiteAppPool.PeriodicRestartRequests
[string]$WebSiteAppPoolPeriodicRestartSchedule = $WebSiteAppPool.PeriodicRestartSchedule
[string]$WebSiteAppPoolPeriodicRestartTime = $WebSiteAppPool.PeriodicRestartTime
[string]$WebSiteAppPoolPingingEnabled = $WebSiteAppPool.PingingEnabled
[string]$WebSiteAppPoolPingInterval = $WebSiteAppPool.PingInterval
[string]$WebSiteAppPoolPingResponseTime = $WebSiteAppPool.PingResponseTime |
# WebSite AppPool Information
$WebSiteAppPools = Get-CimInstance -Namespace "root\MicrosoftIISv2" -ClassName "IIsApplicationPoolSetting" -OperationTimeoutSec 15 -EA Stop
$WebSiteAppPool = $WebSiteAppPools[0];
# IIS AppPool Periodic Restart Information
[string]$WebSiteAppPoolPeriodicRestartMemory = $WebSiteAppPool.PeriodicRestartMemory
[string]$WebSiteAppPoolPeriodicRestartPrivateMemory = $WebSiteAppPool.PeriodicRestartPrivateMemory
[string]$WebSiteAppPoolPeriodicRestartRequests = $WebSiteAppPool.PeriodicRestartRequests
[string]$WebSiteAppPoolPeriodicRestartSchedule = $WebSiteAppPool.PeriodicRestartSchedule
[string]$WebSiteAppPoolPeriodicRestartTime = $WebSiteAppPool.PeriodicRestartTime
[string]$WebSiteAppPoolPingingEnabled = $WebSiteAppPool.PingingEnabled
[string]$WebSiteAppPoolPingInterval = $WebSiteAppPool.PingInterval
[string]$WebSiteAppPoolPingResponseTime = $WebSiteAppPool.PingResponseTime
You can find more properties in my blog.
Posted in Windows Powershell | No Comment | 1,531 views | 14/08/2015 17:26
These are IIS Website Binding 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 Binding Information
$WebSiteBinding = $WebSite.ServerBindings[0]
[string]$WebSiteBindingHostname = $WebSiteBinding.Hostname
[string]$WebSiteBindingIP = $WebSiteBinding.IP
[string]$WebSiteBindingPort = $WebSiteBinding.Port |
# Get WebSites
$WebSites = Get-CimInstance -Namespace "root\MicrosoftIISv2" -ClassName "IIsWebServerSetting" -OperationTimeoutSec 15 -EA Stop
$WebSite = $WebSites[0];
# WebSite Binding Information
$WebSiteBinding = $WebSite.ServerBindings[0]
[string]$WebSiteBindingHostname = $WebSiteBinding.Hostname
[string]$WebSiteBindingIP = $WebSiteBinding.IP
[string]$WebSiteBindingPort = $WebSiteBinding.Port
You can find more properties in my blog.
Posted in Windows Server | No Comment | 1,225 views | 02/08/2015 18:51
Just a reminder for myself :)
@(userRole == 0 ? "Yes" : "No") |
@(userRole == 0 ? "Yes" : "No")
Also you can use this like “else if”:
@(userRole == 0 ? "Yes" : userRole == 1 ? "Yes" : "No") |
@(userRole == 0 ? "Yes" : userRole == 1 ? "Yes" : "No")
You can use this statement in div tags without problem.
|