Hi. I came across this powershell script and would like to modify to include TimeStamp + RecordType values.
I tried adding additional columns. The column headings output but no values so I guess I did it wrong :)
[quote]
# Using WMI, retrieve all the duplicate DNS records
$DNS
=Get-WmiObject-ComputerName'MyServer'`
-Namespace'root\MicrosoftDNS'`
-ClassMicrosoftDNS_AType`
-Filter"ContainerName='MyZone'"|`
Group-Object
OwnerName|Where-Object{$_.Count-gt1}
# Create our CSV file to hold the data
$file
='c:\scripts\DNSDuplicates.csv'
New-Item
-ItemTypefile-Path$file-Force
Add-Content
-Path$file-Value"Name,IPAddress"
# Iterate of the DNS items grabbing the name and IPAddress
foreach
($itemin$DNS) {
foreach($IPAddressesin$item.Group) {
$value="{0},{1}"-f$item.name,$IPAddresses.IPAddress
Add-Content-Path$file-Value$value
}
}
[/quote]
Can any of you gurus assit?
Kind Regards,
Phil