What is wrong with my Retirement script?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

What is wrong with my Retirement script?

L3 Networker
I am attempting to write a script to do a mass retirement of certificates that are expired and no longer in use. For the sake of testing I am only doing the first path in the array. All of the VenafiPS commands work until I get to Invoke-VenafiCertificateAction to retire the first certificate in the array. It says thatA permissions error was encountered. Ensure both the permiUnfortunately the rest is cut off. I dont understand where the permissions issue is. I am a master admin and using my credentials. The API Application Integration is VenafiPS with all but Delete and Revoke permissions. The scope of the VenafiSession includes manage and discover for certificates. I am hoping someone with more experience with the API that myself might have a thought on this. My script is below.$creds = Get-Credential$VenafiSession = New-VenafiSession -Server 'https://venafi.company.com' -Verbose -Credential $creds -ClientId 'VenafiPS' -Scope @{'certificate'= 'manage,discover'} -PassThru$certPath = '\VED\Policy\Xpired_Revokd_Old Certs\Retired Certificates'$retFolder = Find-VenafiCertificate -Path $certPath -VenafiSession $VenafiSession$toRetire = @()#Extracts ONLY the full path to the certificate to be retired within the folder designated in $certPathforeach ( $retPath in $retFolder ){ $toRetire += $retPath.'Path'}echo $toRetire[0]Invoke-VenafiCertificateAction -VenafiSession $VenafiSession -CertificateID $toRetire[0] -Retire.
0 REPLIES 0
  • 27 Views
  • 0 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!