0

Powershell create certficate

Hello,

I want to perform a certificate creation request in powershell

Whith postman
{
"CADN": "\\ved\\policy\\_CA Template\\BP - Certificat SSL",
"Subject": "test15",
"PolicyDN": "\\VED\\Policy\\Certificats\\Test",
"SubjectAltNames": [{"Type": 2,"Name":"test15"}]
}

With powershell


function create_cert(){
$json = @{PolicyDN="\\VED\\Policy\\certificats\\Test";CADN="\\ved\\policy\\_CA Template\\BP - Certificat SLL" ;Subject="test15"}|ConvertTo-Json
$uri =$baseurl+ '/Certificates/Request?apikey=' + $global:key
$create = Invoke-RestMethod -Uri $uri -Body $json -Method POST -ContentType 'application/json'
return $create.Result
}

How to add "SubjectAltNames" with powershell ?


Bests regards


Yann

4 comments

Please sign in to leave a comment.