PowerShell Tip of the Week: Get FQDN

Today I want to show you how to use .Net class to get FQDN (Fully Qualified Domain Name). A fully qualified domain name is the complete domain name for a specific computer. The FQDN consists of two parts: the hostname and the domain name like for example: DC01.powershellbros.com Get FQDN In this article we will focus on DNS class which is a static class that retrieves information about a specific …

Remove stale DNS records

In today article I want to show you script which how in automatic way remove stale DNS records. In big environments there is often situation that DNS contains stale records which are causing mess. Script which I prepared is scanning dns zone defined at the beginning for records which timestamp is older than specific number of days (NumberOfDaysBack variable). Once all are gathered, script remove stale DNS records. Script: NOTE: …

Remove wrong PTR records from your DNS

Recently I wanted to remove wrong PTR records in one of the customer production environment. After quick analysis I observed that it is not so easy easy to do manually, so decided to write Powershell script. What script is doing? Script gahters all PTR records from Reverse lookup zone provided in $ZoneName variable. In next step it convert PTR record to standard IP format and checks if hostname record assigned …

Protect resources from accidental deletion

Today I want to share with you my script which will help protect resources from accidental deletion. In first way script is gathering all domains in Active Directory forest. Next OU and DNS zone objects which are unprotected are pulled out. Final step is setting flag ProtectedFromAccidentalDeletioin for those objects to $True. And this is how you should protect resources from accidental deletion. 🙂 Script: As script is scanning all …

Updating DNS alias using Powershell

Hello Folks, today we will talk a little bit about updating DNS alias record. Recently I want to change DNS alias record name to the new one, however doing it manually is not possible. Alias name field is not editable, there is only an option to change target host.   It’s also not possible directly from powershell, but I’ve created a function which will: – automatically delete old record, – …