More Lunches Chapter 7 Lab question 4.

rated by 0 users
This post has 1 Reply | 1 Follower

Not Ranked
Posts 1
icol Posted: 03-28-2012 9:46 AM

Hi Don,

I just can't get enough of powershell now that I have the More Lunches book =).

I would really appreciate it if you could advise on Lab question 4 Chapter 7.

The question asks: "Write a command that uses pipeline parameter binding to retrieve a list of running processes from every computer in an AD domain. Don’t use parentheses."

The answer is: get-adcomputer -filter * | select-object @{l='computername';e={$_.name}} | get-process -name *

When I run the above I only have the Localhost processes returned not the other (2) remote computers.

If i run: get-adcomputer -filter * | select-object @{l='computername';e={$_.name}}

This returns the names of all of the computers in the domain i.e.

computername                                                                                                                                                                                                                                                      
------------                                                                                                                                                                                                                                                      
SERVER1                                                                                                                                                                                                                                                           
SERVER2                                                                                                                                                                                                                                                           
SERVER3

I can run: Get-process -computername Server1,Server2,Server3 and this displays the processes of all the computers without issue.

Am I doing it wrong?

I very much look forward to your response.

Top 10 Contributor
Posts 640

You appear to be doing it correctly, but the stated answer works for me. Not sure why it isn't for you.

Page 1 of 1 (2 items) | RSS
Copyright 2012 PowerShell.com. All rights reserved.