1 2 3 4 5 6 7 8 9 10 11 12 13 | Get-Content 'C:\ips.txt' | Sort-Object | Group-Object | % { $ip=$_.name #Add more IP #Example 66. if($ip -contains "66.") { $ip, [System.Net.Dns]::GetHostbyAddress($_).HostName } else { $ip } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 | Get-Content 'C:\ips.txt' | Sort-Object | Group-Object | % { $ip=$_.name #Add more IP #Example 66. if($ip -contains "66.") { $ip, [System.Net.Dns]::GetHostbyAddress($_).HostName } else { $ip } } |