Advertisement
Guest User

Untitled

a guest
Jul 18th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. $securePassword = $true
  2.  
  3. Import-Module WebAdministration
  4.  
  5. foreach ($appPool in (ls IIS:\AppPools|?{$_.name -inotmatch 'v4'}))
  6. {
  7. $props = [ordered]@{}
  8.  
  9. $props.name = $appPool.name
  10. $props.queueLength = $appPool.queueLength
  11. $props.autostart = $appPool.autoStart
  12. $props.startmode = $appPool.startMode
  13. $props.state = $appPool.state
  14. $props.runtimeVersion = $appPool.managedRuntimeVersion
  15.  
  16. if ($appPool.enable32BitAppOnWin64) {$props.bitness = '32bit'} else {$props.bitness = '64bit'}
  17.  
  18. $props.processModel = @{}
  19.  
  20. $props.processModel.identityType = $appPool.processModel.identityType
  21. $props.processModel.loadUserProfile = $appPool.processModel.loadUserProfile
  22. $props.processModel.idleTimeout = $appPool.processModel.idleTimeout.toString()
  23. $props.processModel.idleTimeoutAction = $appPool.processModel.idleTimeoutAction
  24. $props.processModel.shutdownTimeLimit = $appPool.processModel.shutdownTimeLimit.toString()
  25. $props.processModel.startupTimeLimit = $appPool.processModel.startupTimeLimit.toString()
  26.  
  27. if ($appPool.processModel.identityType -ieq 'SpecificUser')
  28. {
  29. $props.processModel.userName = $appPool.processModel.userName
  30. if ($securePassword)
  31. {
  32. $props.processModel.password = '*********'
  33. }
  34. else
  35. {
  36. $props.processModel.password = $appPool.processModel.password
  37. }
  38. }
  39.  
  40. $props.recycling = @{}
  41.  
  42. $props.recycling.disallowOverlappingRotation = $appPool.recycling.disallowOverlappingRotation
  43. $props.recycling.disallowRotationOnConfigChange = $appPool.recycling.disallowRotationOnConfigChange
  44. $props.recycling.recycleTimeInterval = $appPool.recycling.periodicRestart.time.totalMinutes
  45. $props.recycling.privateMemoryLimitKB = $appPool.recycling.periodicRestart.privateMemory
  46. $props.recycling.virtualMemoryLimitKB = $appPool.recycling.periodicRestart.memory
  47. $props.recycling.requestLimit = $appPool.recycling.periodicRestart.requests
  48.  
  49. $props.recycling.scheduledTimes = @()
  50.  
  51. foreach ($time in $appPool.recycling.periodicRestart.schedule.collection)
  52. {
  53. $props.recycling.scheduledTimes += $time.value.toString()
  54. }
  55.  
  56. $props|ConvertTo-Json -Compress
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement