I have a list of IP Address in a CSV and need help trying to get the last octet of each IP address to use in a command for creation of DNS records.
IP ADDRESS
10.1.1.20
10.1.1.21
10.1.1.22
10.1.1.23
10.1.1.24
I used this code to find the IP for the first array.
$csv = Import-Csv -Path C:\Users\abcd\Desktop\ptr.csv
$csvip = $csv.ipaddress[0].split('.')[-1]
$csvip
How do I do this for each IP address?
IP ADDRESS
10.1.1.20
10.1.1.21
10.1.1.22
10.1.1.23
10.1.1.24
I used this code to find the IP for the first array.
$csv = Import-Csv -Path C:\Users\abcd\Desktop\ptr.csv
$csvip = $csv.ipaddress[0].split('.')[-1]
$csvip
How do I do this for each IP address?
99upgrade