Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to set the current properties using powershell

  1. disallowRotationOnConfigChange
  2. disallowOverlappingRotation

I do this with the following code

$appPools = Get-childItem IIS:\AppPools
foreach ($appPool in $appPools)
{
    $appPool.name
    Set-ItemProperty $path -Name recycling.disallowRotationOnConfigChange -value True
    Set-ItemProperty $path -Name recycling.disallowOverlappingRotation -value True
}

after this executes I go check in inetmgr and the properties have not budged from False... what am I doing wrong here ?

share|improve this question

1 Answer 1

Stupid me this script misses an entire line :)

for those who haven't spotted it the script should read

$appPools = Get-childItem IIS:\AppPools
foreach ($appPool in $appPools)
{
    $path = "IIS:\AppPools\$($appPool.Name)"
    $appPool.name
    Set-ItemProperty $path -Name recycling.disallowRotationOnConfigChange -value True
    Set-ItemProperty $path -Name recycling.disallowOverlappingRotation -value True
}

no good not defining $path :)

This fixes the above script

share|improve this answer
    
Did this fix it? –  BenjiWiebe Feb 1 '13 at 13:38
1  
yes but i can't accept my own answer for two days –  krystan honour Feb 1 '13 at 14:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.