Last active
August 31, 2022 17:21
-
-
Save HarmJ0y/f556a478f42139010f6081d99c9e5595 to your computer and use it in GitHub Desktop.
wmi_dns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get all zones: | |
Get-WmiObject MicrosoftDNS_Zone -Namespace Root\MicrosoftDNS -ComputerName primary.testlab.local | Select ContainerName | |
Get all A records from a zone: | |
Get-WmiObject -Namespace Root\MicrosoftDNS -Query "SELECT * FROM MicrosoftDNS_ResourceRecord WHERE ContainerName='testlab.local'" -ComputerName primary.testlab.local | ?{$_.TextRepresentation -match " A "} | Select -Expand TextRepresentation | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment