« Previous Next »

Thread: restart remote websites

Last post 10-14-2009 5:50 AM by rkr31. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 10-06-2009, 11:12 AM

    • amackan
    • Not Ranked
    • Joined on 09-22-2009, 8:01 AM
    • Posts 7

    restart remote websites

    Hi, running iis7 on our network. i need to write a script that will stop a particular website on our internal web server and the associated apppool. we currently use iisweb to do this on our iis6 server.

     

    can some one point me in the right direction. my desktop pc is vista 32 bit running powershell 1 with the IIS7 powershell tools installed.

     

    thanks

  • 10-13-2009, 12:00 AM In reply to

    Re: restart remote websites

    Hi,

    Please check the following article:

    How Can I Use Windows PowerShell to Start a Service on a Remote Computer?
    http://blogs.technet.com/heyscriptingguy/archive/2006/06/21/how-can-i-use-windows-powershell-to-start-a-service-on-a-remote-computer.aspx

    Leo Tang
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • 10-14-2009, 5:50 AM In reply to

    • rkr31
    • Top 200 Contributor
    • Joined on 05-01-2007, 6:15 AM
    • Posts 30

    Re: restart remote websites

    Here is one i created to do the same.  Just pass it the name of your site (It assumes that your pool is the same name as the site. )

    ### Get the parameters from the command line
    #
    param([string]$sitename)


    ### Import all the modules we need
    #
    Import-module WebAdministration | out-null

    ### Restart the site
    #
    Restart-WebItem iis:\sites\$sitename
    Restart-WebItem iis:\apppools\$sitename

Page 1 of 1 (3 items)
Microsoft Communities