Announcement

Collapse
No announcement yet.

Recycle Application Pool by PowerShell

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Recycle Application Pool by PowerShell

    Hi All,

    A need to recycle application pool on windows 2008 server. I know exactly name of Application pool. I am new to power shell and i dont know how to yet.

    On server I have application pool named "agamky.cz"

    I have instaled Power Shell 2. Please Can you help me?

    $appPool = Get-WmiObject -NameSpace "webAdministration" -Class "ApplicationPool"

    so If I try to do:

    $appPool {enter} I will get list of all application pools.

    I need to recycle Agamky.cz, how can i do that?


    Thanks
    Thanks

    Caspi

  • #2
    Re: Recycle Application Pool by PowerShell

    Why i cannot use this:

    $appPool.name = "Agamky.cz"

    It return: Property name cannot be found on this object.



    I got it:

    $appPool = Get-WmiObject -NameSpace "webAdministration" -Class "ApplicationPool" Where {$_.name -eq "Agamky.cz"}

    $appPool.Recycle()

    Last edited by caspi; 10th December 2009, 08:08.
    Thanks

    Caspi

    Comment

    Working...
    X