Get commands and whether one is needed to get disk size and memory usage added to list of computers

Good morning and thank you. What I’ve been trying to do is I’m trying to create a query that can identify all computers that have a specific nomenclature involved to give me computer name IP address and this work

Get-ADComputer -fliter 'Name -like “NAME” -Properties IPV4Address | FT NAME, DNSHOSTNAME, IPV4Address -A

The problem comes in when I try to add a command that will also give me a specific drive space and the percentage of free space on that drive. Is there a way to add that ability to the command above so that I can also include that the specific drive data?

To be entirely honest even if I can just pull the above picture that could work as well but I’ve only been able to get either the size or the free space I haven’t been able to combine the two in any command yet. Beyond that add it to my query.

You don’t show any code related to disk space, do you have code you can show? Working on assumptions here, but you can specify a -DriveLetter if you want a specific drive or just loop through all available volumes since all are returned by default from Get-Volume

Not sure what code you need, with Get-Volume I can’t get it to go where I gaet all the computers that end in a specific nomenclature to show remotely. Like for example all computers on my network that end in old I’d like to get all their volume sizes first and foremost but then add in IPs and so forth.

it sounds like you’re trying to make a great big one-liner when instead you should be writing a script.
You’ll need a way to handle errors for computers returned from AD that aren’t reachable via Get-Volume.
I suggest storing your AD computers in a variable then looping through that with a try/catch block and then maybe outputting a PSCustomobject with the properties you want

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.