How to display ComputerName in output?

Hello,

Im running the following and I pass a list of Domain Controllers to a Get-WmiObject.  In my output, I want to display the name of the DC along with the Name variable from the Get-Wmiobject.  How can I do this?

get-addomaincontroller -filter 'Name -like "acme*"' | sort name | select name | foreach {get-wmiobject win32_computersystemproduct | FT ComputerName, Name}		
July 4th, 2013 11:24am

All WMI objects have a property calles __Server. This saves the computer name the info is coming from:

get-wmiobject win32_computersystemproduct | FT __Server,Name

Free Windows Admin Tool Kit Click here and download it now
July 4th, 2013 11:30am

That works good Raimund....Thanks.
July 5th, 2013 11:07am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics