Link to home
Start Free TrialLog in
Avatar of DP230
DP230Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Command line or script to monitor domain's expired date

Dear Experts, is there any CMD or Powershell scripts to check domains' expiration dates?

Many thanks!
Avatar of serialband
serialband
Flag of Ukraine image

Windows has never had the built-in ability like unix.

Here's what you would do in unix, although they're starting to neuter whois functionality for a lot of sites.
whois netcraft.com | egrep -i 'Expiry'

To do the same for Windows, you'd need to install a powershell script.
https://gallery.technet.microsoft.com/WHOIS-PowerShell-Function-ed69fde6
http://power-shell.com/2014/powershell-scripts/whois-powershell-function/

You can then run the whois command.
whois netcraft.com
ASKER CERTIFIED SOLUTION
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DP230

ASKER

But whois can only be used for .com or some domains, not all. How about other extensions, such as .vn, .cn, .ru?
Are you building a home grown IPS?
In the Windows script, you can change the lookup domain service.  That will allow you to expand the whois searches, but you'd have to enter all the ones you need.  It would also depend on the domains that allow you to query them.
Avatar of DP230

ASKER

@yo_bee: I just want to monitor the expired date of domains, to avoid losing them

Nagios also can check this but only works on whois which is lack of some extensions I said above
Ok.
You Domain registrar should have an alert email when close to expiring or renewal time.

Who do you use?
Avatar of DP230

ASKER

We have some from GoDaddy bit most of them are from local vendor.

What if the domain registered email was not yours but your CEO, boss and they usually forget those notification emails?
Avatar of DP230

ASKER

Problem was solved after using curl (of GET command) and whois on Linux environment.