Trying to get list of IP addresses of computers that have files open (in a particular path) on a server. What I have so far kind of works but the output is more than just the IP address.
$pcnames=get-smbopenfile | where {$_.Path -Like "E:\data\subfolder"} | select-object -property clientcomputername # | format-table -hidetableheaders
foreach ($pc in $pcnames) {
write-host $pc
}
The output from this is:
@{clientcomputername=10.10.11.22}
@{clientcomputername=10.10.11.23}
etc.
How do it get the output to be just:
10.10.11.22
10.10.11.23