powershell - 如何访问 IIS : drive on remote machine via Powershell?

标签 powershell iis

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

在远程计算机上本地运行命令会返回应用程序池列表。是否有必须更改的安全设置?

最佳答案

您忘记加载 WebAdministration 模块:

{ Import-Module WebAdministration; Get-ChildItem -Path IIS:\AppPools }

关于powershell - 如何访问 IIS : drive on remote machine via Powershell?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46197514/

相关文章:

powershell - 如何使用 PowerShell 合并/ 'flatten' 文件夹结构 - 递归

json - 将键/值对添加到哈希表(嵌套在数组中,嵌套在哈希表中)

iis - ColdFusion 的 JWildCardHandler 在 IIS 中做什么?

asp.net-mvc - 将 IIS 7.5 预热模块与 ASP.NET MVC AuthorizeAttribute 结合使用

Powershell正则表达式多行解析

powershell - 将变量传递给 Send-MailMessage

windows - 如何重新编译 Chocolatey 虚拟包?

iis - 作业停止运行?

c# - 调试单元测试时,Visual Studio c# 不应启动 IIS 网站

c# - asp.NET - 在服务器上获取用户名