Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > iis security > march 2006 >

iis security : Getting Server SSL Cert Expiration Info


Jul.Genis NO[at]SPAM gmail.com
3/13/2006 8:12:35 AM
Hello,

I am trying to come up with a solution which will help me gather ssl
certificacte expiration date remotelly. So far the only solution that i
caould come up with is running the following command on remote servers:
certmgr.exe /s -r localmachine my >> \\server\share\exp_date.txt

I tried to run it via wmi but cant seem to get it working. If any one
has a better idea please post it.

here is the wmi code

strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process")
errReturn = objWMIService.Create _
("cmd.exe /c certmgr.exe /s -r localmachine my >>
\\server\share\exp_date.txt", Null, Null, intProcessID)
Ken Schaefer
3/14/2006 12:00:00 AM
You could use psexec from www.sysinternals.com

Cheers
Ken


[quoted text, click to view]
: Hello,
:
: I am trying to come up with a solution which will help me gather ssl
: certificacte expiration date remotelly. So far the only solution that i
: caould come up with is running the following command on remote servers:
: certmgr.exe /s -r localmachine my >> \\server\share\exp_date.txt
:
: I tried to run it via wmi but cant seem to get it working. If any one
: has a better idea please post it.
:
: here is the wmi code
:
: strComputer = "."
: Set objWMIService = GetObject _
: ("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process")
: errReturn = objWMIService.Create _
: ("cmd.exe /c certmgr.exe /s -r localmachine my >>
: \\server\share\exp_date.txt", Null, Null, intProcessID)
:

Jul.Genis NO[at]SPAM gmail.com
3/14/2006 7:41:53 AM
unfortunattel remote shells are forbidden where i work so the only
thing i can use is wmi :(.

psexec would have done the job perfectly though
Ken Schaefer
3/15/2006 12:00:00 AM
How is PSExec any different to what you were doing with WMI? Your WMI script
(as posted) seems to be invoking a remote shell via RPC...

Cheers
Ken

[quoted text, click to view]
: unfortunattel remote shells are forbidden where i work so the only
: thing i can use is wmi :(.
:
: psexec would have done the job perfectly though
:

Jul.Genis NO[at]SPAM gmail.com
3/20/2006 8:09:57 AM
psexec installs a service(then removes it)
AddThis Social Bookmark Button