Lessons Learned

My drop-site for interesting snippets and tips. If it's useful to you as well, great!

Browse by Tags

Tagged Content List
  • Blog Post: Getting SRV Records with PowerShell

    PowerShell leverages .NET, and .NET exposes the System.Net.Dns class, so all should be happy, no?  Evidently not if it comes to SRV records.  Someone asked me how to do it, and I said, “That’s easy.  I’ll get back to you in a few.” A few hours later, I realized it wasn’t so easy. Get-NslookupSrvRecord...
  • Blog Post: Pinging a Hostname with Timeout

    Well, that's simple: $ping = New-Object System.Net.NetworkInformation.Ping; [ bool ]( $ping .Send( $computer , $pingTimeout ).Status -ne 'Success' ); It gets more interesting when we need to verify that $computer is actually valid. We can use [System.Net.DNS]::GetHostAddresses(), but that emits...
Page 1 of 1 (2 items)