【问题标题】:Get-PrintConfiguration doesnt seem to workGet-PrintConfiguration 似乎不起作用
【发布时间】:2016-11-08 01:58:38
【问题描述】:

我正在尝试在联网打印机上使用 Get-PrintConfiguration,但由于某种原因它返回此错误

Get-PrintConfiguration : 未找到指定的打印机。在
行:1 字符:1
+ 获取 PrintConfiguration -PrinterName "Printer1"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~
+ CategoryInfo:未指定:(MSFT_PrinterConfiguration:ROOT/StandardCi...erConfiguration) [获取打印配置],CimException + FullyQualifiedErrorId : HRESULT 0x80070709,Get-PrintConfiguration

我有什么遗漏吗?打印机名称是正确的,我有点相信语法是正确的。

【问题讨论】:

    标签: powershell printing configuration


    【解决方案1】:

    编辑: 我刚刚注意到第二行。如果您通过连接多个字符串来指定打印机名称,请确保将连接用括号括起来。示例:

    Get-PrinterConfiguration -PrinterName ("Printer1" + "-PC1")
    

    希望这能有所帮助。

    原文: 由于我没有足够的声誉来发表评论,因此仅将其发布为答案,但是为了获得正确的答案,您能否提供更多详细信息?也许是代码/脚本示例?

    这对我获得网络打印机配置很有用

    Get-Printer | Where-Object -Property 'Name' -EQ 'Sharp MX-4140N' | Get-PrintConfiguration
    
    PrinterName     ComputerName    Collate    Color      DuplexingMode       
    -----------     ------------    -------    -----      -------------       
    Sharp MX-4140N                  True       True       OneSided           
    

    注意:计算机名称是故意空白的。

    【讨论】:

      猜你喜欢
      • 2019-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-29
      • 2016-02-01
      • 2020-09-23
      • 2010-12-05
      • 2011-06-14
      相关资源
      最近更新 更多