Hi all
   I have the problem with a script converted from VB to Powershell. With VB I could import and read the content of a certificate from Active directory user object. With powershell it looks I get the certificate in binary format and could not read it with CAPICOM. Any Idea? Must the data type be converted in powershell?
$pfad="LDAP://server/cn=" + $tnummer + ",ou=operationalaccounts,ou=useraccounts,dc=domain,dc=net"
$user=New-Object DirectoryServices.DirectoryEntry($pfad)
$userCerts=$user.GetEX("userCertificate") !!!may in this line I get the wrong format
$oCert= New-Object -com "CAPICOM.Certificate"
foreach ($Certificate in $userCerts){
$oCert.import($Certificate)
$oCert.ValidToDate
} |