2011-12-21 31 views

回答

13

Windows PowerShell是永遠的答案!這應該爲您的特定問題做:

# Cycle IIS if it's not running  
Get-Service W3SVC | 
    Where-Object {$_.Status -ne 'Running' } | 
    Start-Service 

Import-Module WebAdministration 

# Cycle websites that are not started 
Get-Website | 
    Where-Object { $_.State -ne 'Started' } | 
    ForEach-Object { $_.Start() } 

希望這有助於

+0

優秀!謝謝。 – strum 2011-12-22 09:53:12

相關問題