Link to home
Start Free TrialLog in
Avatar of chiprule
chipruleFlag for Italy

asked on

How to query host with powershell

Hi guys,
I want to query my hosts of hyper-v cluster on what type of network adapter they have.
In local host i do this powershell command

Get-NetAdapter -Physical | ft

Open in new window


How can I do a script that query a list of hosts?

Thanks
Avatar of n2fc
n2fc
Flag of United States of America image

Run a Remote Script
To run a script on one or many remote computers, use the FilePath parameter of the Invoke-Command cmdlet. The script must be on or accessible to your local computer. The results are returned to your local computer.

For example, the following command runs the DiskCollect.ps1 script on the Server01 and Server02 remote computers.

Invoke-Command -ComputerName Server01, Server02 -FilePath c:\Scripts\DiskCollect.ps1

Open in new window


For more information about the Invoke-Command cmdlet see:
  https://technet.microsoft.com/en-us/library/dd347578.aspx.
Avatar of chiprule

ASKER

Thanks,
but if I want to directly launch script that's returns me the result without the invoke command, how can I do?

In few words a script with embedded list of host.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial