Jump to content
Sign in to follow this  
WesWakeman

Certutil and AutoIT

Recommended Posts

WesWakeman

I've got a simple script here:

 

Local $iPID = RunAs("<an admin user>", "<a domain>", "<a password>", 0, @comspec & ' /k c:/windows/SysWOW64/certutil.exe -config "<a pki ca server>\<a name>" -view -restrict "Issued Common Name=<a username>"', "", @SW_SHOW)

 

Everything between <> has been redacted for obvious reasons. I've tested a script which when run by my admin account directly brings back the correct details however if I try and run the script through autoit CertUtil throws up the following error:

 

CertUtil: -view command FAILED: 0x80040154 (-2147221164)
CertUtil: Class not registered

 

It is registered under the admin account I'm using otherwise it would not have work at the command line but for the last 3 hours I've been trying to figure out how and I'm at my wits end, any help would be appreciated with this.

 

Thanks,

 

Wes

Share this post


Link to post
Share on other sites
SadBunny

Just a wild guess... Have you used #requireadmin?


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites
cres
3 hours ago, SadBunny said:

Just a wild guess... Have you used #requireadmin?

This, and try changing the working directory of RunAS to the folder where certutil.exe is (Your SysWow64 directory)

Share this post


Link to post
Share on other sites
WesWakeman

I haven't used requireadmin as it need to run without further input from the user. I'll try it with it to check though as well as the changing directory. and let you know.

 

Thank you.

 

Wes

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×