2017-09-13 36 views
1
PS C:\WINDOWS\system32> Invoke-Command -ComputerName "UABEP1" -ScriptBlock { Get-ChildItem -Path IIS:\AppPools } 

Cannot find drive. A drive with the name 'IIS' does not exist. 
    + CategoryInfo   : ObjectNotFound: (IIS:String) [Get-ChildItem], DriveNotFoundException 
    + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand 
    + PSComputerName  : UABEP1 

在遠程計算機上本地運行命令將返回應用程序池列表。是否有必須更改的安全設置?如何通過Powershell訪問遠程機器上的IIS:驅動器?

回答

3

你忘了加載WebAdministration模塊:

{ Import-Module WebAdministration; Get-ChildItem -Path IIS:\AppPools } 
相關問題