Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $WebAppPoolUserName = "domainuser"
- $WebAppPoolPassword = "password"
- $WebAppPoolNames = @("Test","Test2")
- ForEach ($WebAppPoolName in $WebAppPoolNames ) {
- $WebAppPool = New-WebAppPool -Name $WebAppPoolName
- $WebAppPool.processModel.identityType = "SpecificUser"
- $WebAppPool.processModel.username = $WebAppPoolUserName
- $WebAppPool.processModel.password = $WebAppPoolPassword
- $WebAppPool.managedPipelineMode = "Classic"
- $WebAppPool.managedRuntimeVersion = "v4.0"
- $WebAppPool | set-item
- }
- Set-ItemProperty 'IIS:AppPoolsDemoPool' -Name recycling.periodicRestart.requests -Value 100000
- add-webconfiguration system.applicationHost/applicationPools/applicationPoolDefaults/recycling/periodicRestart/schedule -value (New-TimeSpan -h 1 -m 30)
- %appcmd% set apppool "BusinessUserApps" /+recycling.periodicRestart.schedule.[value='01:00:00']
- $WebAppPool.recycling.periodicRestart.schedule = (New-TimeSpan -h 1 -m 30)
- clear-ItemProperty IIS:AppPoolsMyPoolName -Name Recycling.periodicRestart.schedule #clear values
- set-ItemProperty IIS:AppPoolsMyAppPoolName -Name Recycling.periodicRestart.schedule -Value @{value="00:00:00"} #to set it to midnight
- $webapppool.recycling.periodicrestart.schedule -Value "01:30:00"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement