WhoIs PowerShell Function

WhoIs PowerShell function will perform a domain name lookup and return information such as domain availability (creation and expiration date),  domain ownership, name servers, etc..

Add this function to a module or save it as ps1 file and dot source it in your profile:



3 thoughts on “WhoIs PowerShell Function”

  1. I would love to use your function but, I have not been able to get the below code to work (took it down to bare minimums for troubleshooting).

    $domain = “power-shell.com”
    $whois = New-WebServiceProxy -uri “http://www.webservicex.net/whois.asmx?WSDL”

    I get the below errors.

    Missing ')' in method call.
    At C:\Temp\Domain.ps1:4 char:19
    + (($Whois.getwhois( <<<< =$domain)).Split("<<<")[0])
    + CategoryInfo : ParserError: (CloseParenToken:TokenId) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingEndParenthesisInMethodCall

    I've tried it with different domain names and quoted around the "=$domain" (like I've seen elsewhere) without improvement. Attempted it on Windows 7 and Windows 10.

    Any help would be appreciated.

    1. There is an error in the code at line 12 remove the = sign before $domain.

      Should be:

  2. I wish I could get this too. It would be extremely useful. This script should be either fixed or removed since it doesn’t work.

Leave a Reply

Your email address will not be published. Required fields are marked *