Jump to content

Can I read certificates info with WMI


Recommended Posts

Posted

Hi,

 

I am trying to find out if I can use VBScript/WMI to read the information

contained within a certificate.

 

Using Scriptomatic, I get the following script, but nothing is returned:

 

On Error Resume Next

 

Const wbemFlagReturnImmediately = &h10

Const wbemFlagForwardOnly = &h20

 

arrComputers = Array("localhost")

For Each strComputer In arrComputers

WScript.Echo

WScript.Echo "=========================================="

WScript.Echo "Computer: " & strComputer

WScript.Echo "=========================================="

 

Set objWMIService = GetObject("winmgmts:\\" & strComputer &

"\root\ServiceModel")

Set colItems = objWMIService.ExecQuery("SELECT FROM ClientCredentials",

"WQL", _

wbemFlagReturnImmediately +

wbemFlagForwardOnly)

Wscript.Echo "Starting now..."

 

For Each objItem In colItems

WScript.Echo "ClientCertificate: " & objItem.ClientCertificate

WScript.Echo "HttpDigest: " & objItem.HttpDigest

WScript.Echo "IssuedToken: " & objItem.IssuedToken

WScript.Echo "Peer: " & objItem.Peer

WScript.Echo "ServiceCertificate: " & objItem.ServiceCertificate

WScript.Echo "SupportInteractive: " & objItem.SupportInteractive

WScript.Echo "Type: " & objItem.Type

WScript.Echo "UserName: " & objItem.UserName

WScript.Echo "Windows: " & objItem.Windows

WScript.Echo

Next

Next

WScript.Echo "Execution is now complete."

 

Can anyone tell me how to accomplish this? Solution need not be limited to

WMI. I actually prefer straight VBScript.

 

TIA,

Rich

  • Replies 0
  • Created
  • Last Reply

Popular Days

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...