1

PS newbe here...

How do I get the remote computer name to appear in the output?

$computer = "PC3090-121","APCD02" 
Get-WmiObject Win32_Printer -ComputerName $computer |
  Select-Object SystemName,Name,Local |
  Format-Table -AutoSize

I've tried including -computername, computername, %computername% in the Select and format-table -properties - no joy...

My searches have come up empty, or I couldn't understand them.

------------------------------ answer:

$computer = "PC3090-121","APCD02" 
Get-WmiObject Win32_Printer -ComputerName $computer |
  Select-Object  __Server, Name, Local |
  Format-Table -AutoSize
4

1 回答 1

4

简单点怎么样

Get-WmiObject Win32_Printer -ComputerName $computer |
  Select-Object SystemName,Name,Local |
  Format-Table -AutoSize

结果对象没有computername属性,也没有%computername%属性。存在的是SystemName.

于 2013-09-05T15:49:31.850 回答