Citrix Web Interface 5.x and IIS 7.0 Slow logon for first time usage

I’ve seen this time and again, during the different version of Web Interface. It was there in IIS 6.x and still is in IIS 7.0. The problem is slow performance for the first user logging on to Web Interface.
This is because the citrix application pool in IIS is, by default, set to recycle nightly at 02:00. After the recycle the web-interface is rebuilt causing a delay to the first user to attempt to log in.
This delay can result in users logging tickets / support cases for a slow login process. For this reason, I would recommend you to disable this value, to get rid of any extra support cases.

Pleae note that in some cases you will not be able to run the script. If so open up powershell and run the following command “set-executionpolicy unrestricted”

Powershell script:
if (!(get-module | where {$ -eq “webadministration”})){
if (!(get-module -listavailable | where {$ -eq “webadministration”})){
write-error “WebAdministration snapin not available, failing”
#this is needed as the module is seen as a script in some cases
 set-executionpolicy unrestricted -force
#add the module
 write-host “adding IIS Powershell Module”
import-module webadministration
 }#end if
$CitrixPool = get-childitem “IIS:\AppPools” | where {$ -eq “CitrixWebInterface5.4.0AppPool”}
$schedulePath = $CitrixPool.ItemXPath + “/recycling/periodicRestart”
$count = $CitrixPool.recycling.periodicRestart.schedule.Collection.Count
#remove scheduled time(s)
 Do {
 Remove-WebconfigurationProperty $schedulePath -Name schedule.collection -AtIndex ($count – 1) -Force
Until ($count -eq “0″)
Please note, this will set your powershell execution policy to unrestricted, this is a side affect of the WebAdministration calling a script.
To revert at the end of the script, run the following command after utilizing this script “set-executionpolicy restricted”