PowerShell + WebAdministration - How to get website from webapplication?

后端 未结 3 651
滥情空心
滥情空心 2021-01-17 16:39

I\'m writing a PowerShell script to perform certain administrative functions in IIS 7.5.

import-module WebAdministration

In some cases I kn

3条回答
  •  情深已故
    2021-01-17 17:37

    Try this

    $app = get-webapplication -name 'MyApp'
    foreach($a in $app)
    {
    $a.Attributes[0].Value;
    }
    

    This will give you all the names of the Web Applications, sometimes you can have more than 1 name for a single Web Applications.

    For more information see the link

    http://nisanthkv.blog.com/2012/07/06/name-of-web-applications-using-powershell/

    Hope it helps..

提交回复
热议问题