🇬🇧 | 🇩🇪 | 🇫🇷 | 🇪🇸 | 🇨🇳 | 🇸🇦
我们没有DLL,但我们有:
Windows文件分析器和在线快速反病毒

一个简约的界面,具有快速搜索,方便的上传和干净的部分结构.

🛡️🔍 快速验证你的档案,只需要放上这个页面.
病毒检查,哈希,签名验证,架构,人工智能信息.

如何修复 "WS管理服务无法处理请求. 编号操作的资源URI不能包含密钥. "

错误的描述

This error occurs in Windows PowerShell or Windows Remote Management (WinRM) when an Enumerate 操作 (例如: Get-WSManInstance 或是 Get-CimInstance ) 是用错误地包含特定实例密钥的资源URI执行的.

在WS管理协议规则中, Enumerate 操作是用来查询的. 所有的 instances or a collection of objects from a specific class provider. Because it is meant to return a list of multiple items, the Resource URI must point generally to the resource type or class container. If you include specific selectors or keys (like a specific IP address, session ID, or service name) inside the URI string during an enumeration request, the WinRM service rejects it because keys are strictly reserved for Get, Put 或是 Delete 针对单个特定实例的操作.


简单的解决方案

要解决这个问题,您必须修改您的 PowerShell 脚本或命令,在列出项目时从 URI 参数中删除实例特定标识符,或者切换到正确的操作方法,如果您只想向单个项目.

方法1:从资源URI中删除键 (用于列出多个项目)

如果您的目标是列出或列举所有案例,请确保您的 -ResourceURI 在类或容器级别的字符串停止.

  1. Locate your current command. 它看起来很像这个错误的例子:

    Get-WSManInstance -ResourceURI "winrm/config/listener?Address=*+Transport=HTTPS" -Enumerate

    注:地址是: +Transport=HTTPS`部分表示导致故障的密钥.*

  2. Modify the URI to exclude the keys. 从问号开始,把所有的东西都拿走 ( ? 没有.

    Get-WSManInstance -ResourceURI "winrm/config/listener" -Enumerate
  3. Run the corrected command. 现在 WinRM 服务将成功处理列表并列出所有可用的听者.

方法2:将操作更改为"获取" (针对单个项目)

If you intentionally included keys because you only want information about one specific configuration instance, you must drop the -Enumerate 切换并使用标准检索方法.

  1. Locate your command using the Enumerate switch:

    Get-WSManInstance -ResourceURI "winrm/config/listener?Address=*+Transport=HTTP" -Enumerate
  2. Remove the -Enumerate switch (如果使用CIM/WMI cmdlets,则可以用特定实例选择器替换它),以便Windows知道您正在获取单个对象:

    Get-WSManInstance -ResourceURI "winrm/config/listener?Address=*+Transport=HTTP"
  3. Execute the command. 窗口会查找与您的键匹配的正确项,而不需要触发编号限制.

方法3:重新启动 WinRM 服务 (如果使用自动化工具)

如果此错误是由第三方管理工具,编排软件或自动部署脚本造成的,并且无法更改代码,则重新启动本地 WinRM 服务可以清除受损的会话状态.

  1. 打开 PowerShell 作为一个管理员 (右键单击 PowerShell -> 运行作为管理员).
  2. 输入下面的命令重新启动服务:
    Restart-Service WinRM -Force
  3. 验证服务状态正在运行:
    Get-Service WinRM

为了帮助确定确切的语法调整, specific PowerShell command 或是 software tool 您是否正在尝试? list all items 或是 target a single configuration entry.

ERROR_WSMAN_WMI_CANNOT_CONNECT_ACCESS_DENIED | ERROR_WSMAN_INVALID_FILTER_XML | ERROR_WSMAN_INVALID_FRAGMENT_PATH_BLANK | ERROR_WSMAN_INVALID_CHARACTERS_IN_RESPONSE | ERROR_WSMAN_KERBEROS_IPADDRESS

可能有一些错误.. Learn Microsoft