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 Trusted Domain Computer Names

    The -replace '\..*', $domain snippet is in case here's some AD funkiness that returns the FQDN from the external DNS record instead of internal. Some of my labs expose machines to other labs. Dammit, Jim, I'm a lab admin, not the DNS guru. function Get-ComputerNameFromTrustedDomain { if ( ! ( Get...
  • 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 (3 items)