Restriction on CertView with template not working


hi there,

we're querying our certificate services database powershell script, uses icertview2-com-object (http://msdn.microsoft.com/en-us/library/windows/desktop/aa385439(v=vs.85).aspx)

i trying use $caview.setrestriction() filter out certificates of template, without luck far. tried available choices (e.g. definining lower 0x2 , upper boundaries 0x10 filtering, , 0x1 equal)

caview = new-object -comobject certificateauthority.view $caview.openconnection("hostname.domain.local\someca")

$properties = "requestid", "requestername", "commonname", "notbefore", "notafter", "serialnumber", "certificatetemplate"  

$caview.setresultcolumncount($properties.count) $properties | %{$caview.setresultcolumn($caview.getcolumnindex($false,$_))} 

$rcolumn = $caview.getcolumnindex($false, "notafter") 

$lcolumn = $caview.getcolumnindex($false, "commonname")

$tcolumn = $caview.getcolumnindex($false, "certificatetemplate")

$caview.setrestriction($lcolumn, 0x2, 0, "someca-xchg")

$caview.setrestriction($rcolumn, 0x10, 0, [datetime]::now) 

$caview.setrestriction($rcolumn, 0x2, 0, [datetime]::now.adddays($args[1])) 

$caview.setrestriction($tcolumn, 0x2, 0, "1.2.3.4.5.6.232314.412343.456435.555434")

$row = $caview.openview()


maybe can enlighten me, have no idea what's going wrong :(

kind regards,

mmf


you can try powershell pki module: http://pspki.codeplex.com/

the following syntax used:

get-ca ca01.domain.com | get-issuedrequest -filter "certificatetemplate -eq caexchange"

for additional information may refer online documentation (on project main page).


my weblog: http://en-us.sysadmins.lv
powershell pki module: http://pspki.codeplex.com
windows pki reference: on technet wiki



Windows Server  >  Security



Comments

Popular posts from this blog

CRL Revocation always failed

Failed to query the results of bpa xpath

0x300000d errors in Microsoft Remote Desktop client