Advertisement
Guest User

Untitled

a guest
Apr 8th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. $WebAppPoolUserName = "domainuser"
  2. $WebAppPoolPassword = "password"
  3.  
  4. $WebAppPoolNames = @("Test","Test2")
  5.  
  6. ForEach ($WebAppPoolName in $WebAppPoolNames ) {
  7. $WebAppPool = New-WebAppPool -Name $WebAppPoolName
  8. $WebAppPool.processModel.identityType = "SpecificUser"
  9. $WebAppPool.processModel.username = $WebAppPoolUserName
  10. $WebAppPool.processModel.password = $WebAppPoolPassword
  11. $WebAppPool.managedPipelineMode = "Classic"
  12. $WebAppPool.managedRuntimeVersion = "v4.0"
  13. $WebAppPool | set-item
  14. }
  15.  
  16. Set-ItemProperty 'IIS:AppPoolsDemoPool' -Name recycling.periodicRestart.requests -Value 100000
  17.  
  18. add-webconfiguration system.applicationHost/applicationPools/applicationPoolDefaults/recycling/periodicRestart/schedule -value (New-TimeSpan -h 1 -m 30)
  19.  
  20. %appcmd% set apppool "BusinessUserApps" /+recycling.periodicRestart.schedule.[value='01:00:00']
  21.  
  22. $WebAppPool.recycling.periodicRestart.schedule = (New-TimeSpan -h 1 -m 30)
  23.  
  24. clear-ItemProperty IIS:AppPoolsMyPoolName -Name Recycling.periodicRestart.schedule #clear values
  25. set-ItemProperty IIS:AppPoolsMyAppPoolName -Name Recycling.periodicRestart.schedule -Value @{value="00:00:00"} #to set it to midnight
  26.  
  27. $webapppool.recycling.periodicrestart.schedule -Value "01:30:00"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement