WesWakeman Posted July 4, 2016 Posted July 4, 2016 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
SadBunny Posted July 5, 2016 Posted July 5, 2016 Just a wild guess... Have you used #requireadmin? Roses are FF0000, violets are 0000FF... All my base are belong to you.
cres Posted July 5, 2016 Posted July 5, 2016 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)
WesWakeman Posted July 5, 2016 Author Posted July 5, 2016 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
WesWakeman Posted July 5, 2016 Author Posted July 5, 2016 #include <Process.au3> #RequireAdmin FileChangeDir ( "c:/windows/SysWOW64/" ) Local $iPID = RunAs("anadminaccount", "adomain", "apassword", 0, @comspec & ' /k c:/windows/SysWOW64/certutil.exe -config "aserver.adomain\aserver" -view -restrict "Issued Common Name=ausername"', "", @SW_SHOW) Sadly still the same see attached.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now