Getting volume on all machines on a different domain

I am new to Powershell so please excuse my ignorance. I need to run a script on a different domain to get the volume info. So far, I have the script below.

icm test1,test2,test3 {get-volume} | sort sizeremaining

There are at least a total of 100 machines out there. How can I get them all with a single command?
Thank you.

Jerry,
Welcome to the forum. :wave:t4:

What’s wrong with the command you have?

And BTW: When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

How to format code in PowerShell.org <---- Click :point_up_2:t4: :wink:

Thank you for your reply. The code works if I am just looking for a few volumes on the current domain. I need at least 100 volumes for machines across a different domain. I have an idea of entering the names for this somewhere along the lines like

-computername -filter "name -like ""lm*mr"""

How would I look for all the machines volume on machines associated with machines that are similar.

Please always read the help for cmdlets you’re about to use completely including examples to learn how to use them.

You have to specify the computernames for the parameter -ComputerName explicitly. You cannot use wildcards.
You can save a list of computernames in an array though and provide this to the command.

thank you! I will give this a shot!