Hi there, what I’d like to achieve is the following: I’ve an csv report with a column of ipaddresses. I’d like to resolve all the ipaddresses to hostnames and update the existing report with that information.
So far I’ve written this what gives me only the list with host names…:
Once you have the IP, you want to pipe it to export-csv (or even add-content to blah.csv). I tend to NOT want to add to the original file in case something goes wrong. Something like this will work:
I wanted to leave some space for you to shine. … my code example is meant as a suggestion - feel free to tweak it to your needs. You could assign the whole code snippet to a variable and export it to a new CSV file or - if you like - to the same CSV file using the parameter -Force.