Monday, August 15, 2011

Refreshing the FIM portal

Carol Wapshere did a nice post on refreshing the FIM portal when you make changes to RCDC and such. I've taken this to heart and put together a small Powershell script to do the job.

You can use the script like this -

"AppPool name" | .\Recycle-IisAppPool.ps1

i.e. "Sharepoint - 80" | .\Recycle-IisAppPool.ps1

You could even send several AppPool names through the pipeline, i.e.

"SomeAppPool", "Another AppPool", "Sharepoint - 80" | .\Recycle-IisAppPool.ps1

Ooh, and the script; here it is (remember to save it with a .ps1 extension)

process
{
 $_ | % { Invoke-WMIMethod -Name Recycle -Namespace "root\MicrosoftIISv2" -Path "IIsApplicationPool.Name='W3SVC/AppPools/$_'" }
}

2 comments:

Carol Wapshere said...

Hi Søren. That is certainly useful. What would be even neater is if you could combine the functionality that Thomas blogged about where you hit the page straight away after the recycle to avoid the delay the first time a user goes there: http://setspn.blogspot.com/2011/06/fim-2010-warm-up-your-portal-iis.html

And remember to post your scripts on the technet wiki as well! :-)

Søren Granfeldt said...

@Carol: Thanks. I'll have a look into it as soon as humanly possible. It would be a nice add-on, also when you're doing development...