Share via

PowerShell script Help

John JY 221 Reputation points
2022-04-06T19:05:39.463+00:00

Hi all,

Is there a way to get DNS dynamic A records for only servers with Windows AD integrated Zone, not including workstations?

Thank you!

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Server | User experience | Other
0 comments No comments

Answer accepted by question author

Rich Matheisen 48,116 Reputation points
2022-04-06T19:19:25.163+00:00

User Get-ADComputer and the -Filter parameter. Look for the condition below. Then get the DNS A record using the name of the computer from the AD.

"operatingsystem -like '*server*'"

Was this answer helpful?


1 additional answer

Sort by: Most helpful
  1. Rich Matheisen 48,116 Reputation points
    2022-04-07T01:52:55.533+00:00

    The safest way is to not to mingle IP address ranges of static and DHCP created records. Then you only need to check the IP address to know if it's been created/updated by DHCP.

    I think a problem you may have is if you've allowed the machines with statically assigned IP addresses to register themselves or update their resource records in DNS. I believe that may add a timestamp value to the resource record. But if that isn't happening then the presence of a timestamp value (or one with a date of 1/1/1601) should identify a "static" record.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.