我正在尝试使用以下方法从证书服务器获取新证书:
$user = "MYDOMAIN\Administrator"
$pw = ConvertTo-SecureString "mypw" -AsPlainText -Force
$credential = New-Object -typename System.Management.Automation.PSCredential -ArgumentList $user,$pw
Get-Certificate -url https://cs.mytest.com/ADPolicyProvider_CEP_UsernamePassword/service.svc/CEP -DnsName $Env:COMPUTERNAME -CertStoreLocation cert:\LocalMachine\My -Template WorkstationTemplate -Verbose -Credential $credential
但是我回来了:
VERBOSE: Performing the operation "Get-Certificate" on target "https://cs.mytest.com/ADPolicyProvider_CEP_UsernamePassword/service.svc/CEP".
Get-Certificate : CertEnroll::CX509CertificateTemplates::get_ItemByName: Cannot find object or property. 0x80092004 (-2146885628 CRYPT_E_NOT_FOUND)
At line:4 char:1
+ Get-Certificate -url https://cs.mytest.com/ADPolicyProvi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-Certificate], Exception
+ FullyQualifiedErrorId : System.Exception,Microsoft.CertificateServices.Commands.GetCertificateCommand
我正在与测试CS相同的机器上执行命令,以确保没有网络问题,并且我以域管理员身份登录。证书服务器在Server 2016上作为独立CA运行。
我想念什么?它在抱怨哪个对象?