header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

[August 25th, 2008] Check the home page regarding PowerShell related news from a brand new sponsor: Idera

Subject: Read a certificate from AD userobject
Prev Next
You are not authorized to post a reply.

Author Messages
scholkerUser is Offline
New Member
New Member
Posts:1

05/02/2008 6:10 AM  

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
}

You are not authorized to post a reply.
Forums > Using PowerShell > Active Directory > Read a certificate from AD userobject



ActiveForums 3.7
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • ShellTools, LLC • Microsoft Windows Server 2008 footer
footer