Pipeline ByPropertyName Question/Help

I am trying to write a small script that will get all domain computers (Get-ADComputer), and return all of the running processes (Get-Process).

Since the value type of Get-ADComputer is different from accepted Get-Process input, I figured I would use the pipeline ByPropertyName input, as the -ComputerName parameter in Get-Process accepts pipeline input ByPropertyName. I figured I would be able to create a psobject with Select-Object, and change the property from “Name” to “ComputerName.

Get-ADComputer -Filter * | Select-Object @{Label = 'ComputerName'; Expression = {$_.name}} | Get-Process 

However when running this, I only get processes returned from the first computer, which I happen to be running this command on.

Any ideas? Am I understanding the pipeline correctly? Do I have incorrect syntax?

submitted by /u/ExistingRanger7
[link] [comments]

Leave a Reply