I'm trying to create a script to audit the IIS recycling times on a number of remote servers. The script I'm attempting is:
$scriptBlock = {
import-module webadministration
Get-itemproperty -Path IIS:\AppPools\WebPage -Name recycling.periodicRestart.schedule.collection}
invoke-command -computername HOSTNAME -ScriptBlock $scriptBlock
Unfortunately, this is returning absolutely nothing. Any idea what I might be doing wrong?