{"id":426,"date":"2018-02-27T15:21:27","date_gmt":"2018-02-27T20:21:27","guid":{"rendered":"http:\/\/nukeitmike.com\/blog\/?p=426"},"modified":"2018-02-27T15:21:27","modified_gmt":"2018-02-27T20:21:27","slug":"dns-powershell-one-liner","status":"publish","type":"post","link":"https:\/\/blog.nukeitmike.com\/index.php\/2018\/02\/27\/dns-powershell-one-liner\/","title":{"rendered":"DNS PowerShell one liner"},"content":{"rendered":"<p>This is a \u201cone liner\u201d that pulls all the DNS Entries for a particular zone, including the IPv4 and IPv6.&#160; If you don\u2019t care about the IPv6, you can remove that segment of the code.<\/p>\n<blockquote>\n<p>Get-DnsServerResourceRecord \u2013ComputerName &lt;DNSServerName&gt; \u2013ZoneName &lt;YourZoneName&gt; | Select-Object DistinguishedName,HostName,@{Name=&#8217;IPv4Address&#8217;;Expression={$_.RecordData.IPv4Address.IPAddressToString}},@{Name=&#8217;IPv6Address&#8217;;Expression={$_.RecordData.IPv6Address.IPAddressToString}},RecordType,Timestamp,TimeToLive | Export-Csv $env:TEMP\\DNSExport.csv \u2013NoTypeInformation<\/p>\n<\/blockquote>\n<p>It is amazing how much you can do with just one line (even if the line is obnoxiously long.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a \u201cone liner\u201d that pulls all the DNS Entries for a particular zone, including the IPv4 and IPv6.&#160; If you don\u2019t care about the IPv6, you can remove that segment of the code. Get-DnsServerResourceRecord \u2013ComputerName &lt;DNSServerName&gt; \u2013ZoneName &lt;YourZoneName&gt; | Select-Object DistinguishedName,HostName,@{Name=&#8217;IPv4Address&#8217;;Expression={$_.RecordData.IPv4Address.IPAddressToString}},@{Name=&#8217;IPv6Address&#8217;;Expression={$_.RecordData.IPv6Address.IPAddressToString}},RecordType,Timestamp,TimeToLive | Export-Csv $env:TEMP\\DNSExport.csv \u2013NoTypeInformation It is amazing how much you can do&hellip; <a class=\"more-link\" href=\"https:\/\/blog.nukeitmike.com\/index.php\/2018\/02\/27\/dns-powershell-one-liner\/\">Continue reading <span class=\"screen-reader-text\">DNS PowerShell one liner<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[25],"tags":[77,126,135],"class_list":["post-426","post","type-post","status-publish","format-standard","hentry","category-scripting","tag-dns","tag-one-liner","tag-powershell","entry"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pcW544-6S","_links":{"self":[{"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/posts\/426","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/comments?post=426"}],"version-history":[{"count":0,"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/posts\/426\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/media?parent=426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/categories?post=426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/tags?post=426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}