Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $securePassword = $true
- Import-Module WebAdministration
- foreach ($appPool in (ls IIS:\AppPools|?{$_.name -inotmatch 'v4'}))
- {
- $props = [ordered]@{}
- $props.name = $appPool.name
- $props.queueLength = $appPool.queueLength
- $props.autostart = $appPool.autoStart
- $props.startmode = $appPool.startMode
- $props.state = $appPool.state
- $props.runtimeVersion = $appPool.managedRuntimeVersion
- if ($appPool.enable32BitAppOnWin64) {$props.bitness = '32bit'} else {$props.bitness = '64bit'}
- $props.processModel = @{}
- $props.processModel.identityType = $appPool.processModel.identityType
- $props.processModel.loadUserProfile = $appPool.processModel.loadUserProfile
- $props.processModel.idleTimeout = $appPool.processModel.idleTimeout.toString()
- $props.processModel.idleTimeoutAction = $appPool.processModel.idleTimeoutAction
- $props.processModel.shutdownTimeLimit = $appPool.processModel.shutdownTimeLimit.toString()
- $props.processModel.startupTimeLimit = $appPool.processModel.startupTimeLimit.toString()
- if ($appPool.processModel.identityType -ieq 'SpecificUser')
- {
- $props.processModel.userName = $appPool.processModel.userName
- if ($securePassword)
- {
- $props.processModel.password = '*********'
- }
- else
- {
- $props.processModel.password = $appPool.processModel.password
- }
- }
- $props.recycling = @{}
- $props.recycling.disallowOverlappingRotation = $appPool.recycling.disallowOverlappingRotation
- $props.recycling.disallowRotationOnConfigChange = $appPool.recycling.disallowRotationOnConfigChange
- $props.recycling.recycleTimeInterval = $appPool.recycling.periodicRestart.time.totalMinutes
- $props.recycling.privateMemoryLimitKB = $appPool.recycling.periodicRestart.privateMemory
- $props.recycling.virtualMemoryLimitKB = $appPool.recycling.periodicRestart.memory
- $props.recycling.requestLimit = $appPool.recycling.periodicRestart.requests
- $props.recycling.scheduledTimes = @()
- foreach ($time in $appPool.recycling.periodicRestart.schedule.collection)
- {
- $props.recycling.scheduledTimes += $time.value.toString()
- }
- $props|ConvertTo-Json -Compress
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement