Little help with a script

Hello guys,

I'm hoping that you guys can give me a little bit of help with a script that i'm trying to write, i'm a beginner when it comes to scripting so you're help it's greatly appreciated. The purpose of the script below is to through to a list of different DNS domain names and search for certain criteria and then display on the screen or file for me, the problem that I'm running into is that I don't know how to display or write to file the variable $dnszone to the screen so that when I get the output for hostnames I can tell from which DNS zone it came from.

Here is the script thus far

$dnszones = Get-Content "C:\all_dnz_zones.txt"
$IPv4Address = "10.10.*"
foreach ($dnszone in $dnszones) {Get-DnsServerResourceRecord -ZoneName $dnszone -ComputerName htxdc01 | Where-Object {$_.RecordData.IPv4Address -like $IPv4Address}}

This is the output that I see write now, i'm missing the $dnszone names :(


  • Edited by Delmiroc 11 hours 53 minutes ago
May 24th, 2015 3:17pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics