是否禁用打印机的“双向通信”?

问题描述 投票:0回答:1

如何使用Powershell禁用“双向通信”?

我在运行时可以看到EnableBIDI

get-WmiObject -class Win32_printer | fl *

但是当我尝试此操作时,它说找不到该属性?

Set-PrinterProperty -PrinterName "Some Printer" -PropertyName "EnableBIDI" -Value $False
powershell wmi powershell-3.0 printers get-wmiobject
1个回答
0
投票

您正在混合来自两个不同WMI类的属性。 Set-PrinterPropertySet-PrinterProperty命名空间操纵未记录的MSFT_PrinterProperty类的实例,该命名空间具有与上一个命令中的root/standardcimv2不同的属性。

相反,请操作Win32_Printer class类的所需实例,因为它具有所需的属性,然后调用Win32_Printer提交更改。当以仰角运行时,这对我有用:

Win32_Printer

使用较新的Put(),您可以使用Put()$printer = Get-WmiObject -Class 'Win32_Printer' -Filter 'Name = ''My Printer Name''' $printer.EnableBIDI = $false $printer.Put() cmdlet以类似的方式进行更改...

CimCmdlets module

...或将其简化为单个管道...

CimCmdlets

...甚至简化为单个cmdlet调用...

Get-CimInstance
© www.soinside.com 2019 - 2024. All rights reserved.