GhostPack / PSPKIAudit

PowerShell toolkit for AD CS auditing based on the PSPKI toolkit.
Microsoft Public License
792 stars 109 forks source link

Invoke-PSPKIAudit not recognized #26

Closed erudes1991 closed 1 year ago

erudes1991 commented 1 year ago

Hello,

I have a problem and I'm pretty sure I'm doing things right. I am trying to run this on my CA server, I have even RSAT Tools install for ADDS. I am able to extract and install the modules but when trying to invoke I get this:

Invoke-PSPKIAudit : The term 'Invoke-PSPKIAudit' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Not exactly sure what I'm missing, I downloaded the files, extracted them, installed the module, what am I missing?

leechristensen commented 1 year ago

Did you run Import-Module .\PSPKIAudit.psm1?

erudes1991 commented 1 year ago

Did you run Import-Module .\PSPKIAudit.psm1?

I have and I get no output, guessing that means succesful though:

image
leechristensen commented 1 year ago

Once it is imported, did you run Invoke-PKIAudit? Alternative ways to run that cmdlet include:

Invoke-PKIAudit -CAComputerName CA.DOMAIN.COM

or

Invoke-PKIAudit -CAName NameOfYourCA
erudes1991 commented 1 year ago

Once it is imported, did you run Invoke-PKIAudit? Alternative ways to run that cmdlet include:

Invoke-PKIAudit -CAComputerName CA.DOMAIN.COM

or

Invoke-PKIAudit -CAName NameOfYourCA
image

It does not work with none of the alternatives.

erudes1991 commented 1 year ago

any hints? :(

erudes1991 commented 1 year ago

I downloaded the zip, extracted it, installed the module, also AD module with RSAT, but receive that during invoking...what am I doing wrong? @leechristensen

image
PatrickOnGit commented 1 year ago

After downloading, did you unblock the files? Usually they are marked as 'downloaded from internet' in an additional file stream. Unfortunately the module seems to load but doesn't. After unblockin, open a new PowerShell window as PoSh remembers that it tried but failed to load.

erudes1991 commented 1 year ago

After downloading, did you unblock the files? Usually they are marked as 'downloaded from internet' in an additional file stream. Unfortunately the module seems to load but doesn't. After unblockin, open a new PowerShell window as PoSh remembers that it tried but failed to load.

I was able to make some progress, I can Invoke Now, but the result fails and -CAName is not recongized as valid command:

image

@PatrickOnGit @leechristensen @SamErde

SamErde commented 1 year ago

What is your comfort level with PowerShell? Just trying to gauge how helpful to try to be here based on the above screenshot. :)

Try running just Invoke-PKIAudit -CAComputerName VMCA1-Cont.contoso.com but replace "VMCA1-Cont.contoso.com with the computer name of your own certificate authority server.

erudes1991 commented 1 year ago

@SamErde VMCA1-Cont.contoso.com is the computer name of my CA server....

I was able to make it work

image

SamErde commented 1 year ago

So you're running this in a lab? Gotcha! Then run that command as-is: Invoke-PKIAudit -CAComputerName "VMCA1-Cont.contoso.com"

erudes1991 commented 1 year ago

thanks I was able to make it work now!

MoppelMat commented 1 year ago

Excuse me for chiming in, but I have the same problem.

First of all: Do I need a Server-OS to run this? I try to make it work on my W10 Workstation, but I fail miserably. image

image

Sorry for german crap, I can translate if needed. Basically the error tells me that the command Get-CertificationAuthority was not found.

I tried with user and admin rights.

I get the same output if I include the name of my CA server, or not.

leechristensen commented 1 year ago

Just updated the readme to include instructions for install the PSPKI module and to import PSPKAudit from its manifest file (.psd1) instead of module file (.psm1). Let me know if that solves your issue @MoppelMat

MoppelMat commented 1 year ago

Just updated the readme to include instructions for install the PSPKI module and to import PSPKAudit from its manifest file (.psd1) instead of module file (.psm1). Let me know if that solves your issue @MoppelMat

that works like a charm now! thank you!