Posts

Showing posts from 2016

Nslookup with PowerShell

I needed a method of validating that  our PTR records matched our DNS records.  I found a lot of scripts that did pieces of each.  I created a script that uses the nslookup tool in Windows and parses the results.  This version does one host at a time but I'm working on integrating it into my DNS validator script.  This is a quick and dirty script, feel free to use it as you see fit. #Requires -version 3.0 Clear-Host $Target = "hostname" Write-Host "Target Hostname = $Target" -ForegroundColor Yellow $HostLookup = (nslookup $Target ) $Lookup = [ PSCustomObject ]@{     DNS_Host = ( $HostLookup [0] -split ‘:’ )[1].Trim()       DNS_IP = ( $HostLookup [1] -split ‘:’ )[1].Trim()  Target_Host = ( $HostLookup [3] -split ‘:’ )[1].Trim()    Target_IP = ( $HostLookup [4] -split ‘:’ )[1].Trim() } Write-Host "Target IP from NSLOOKUP =" $Lookup . Target_IP -ForegroundCo...

SMTP Test Script with GUI

Here is a little script I worked up some time ago to test my SMTP relay.  It brings up a GUI where you populate the required info, saves that for the next run, and sends out a test email. NOTE: The new version and all subsequent updates are at the PowerShell Gallery at  https://www.powershellgallery.com <#==============================================================================          File Name : SMTP_Relay_Test.ps1    Original Author : Kenneth C. Mazie (kcmjr AT kcmjr.com)                    :        Description : This script will send an email to the selected user,                    : SMTP host, and SMTP port.                    :  ...