Reputation: 93
I have followed this guide: https://blogs.msdn.microsoft.com/adpowershell/2009/04/26/working-with-certificates-in-active-directory-powershell/
The certificate is successfully added to the Published Certificates of the user. But it's not what I really want.
Instead I want the certificate to be added to the X509 Certificates of the AD user (Name Mapping / Security Identity Mapping in Active Directory)
Is there a way to do this in C# or Powershell?
Upvotes: 1
Views: 9310
Reputation: 93
So I've resolved the problem by following this guide.
Changed the command a little bit suggested by Mathias.
Set-ADUser -Certificates
Then followed this guide to fill in the parameters of altSecurityIdentities.
Now my certificate is added to X509 Certicates in Security Identity Mapping.
Here is my code:
Set-ADUser USERNAME -Add @{'altSecurityIdentities'="X509:<I>C=BE,CN=Citizen CA,SERIALNUMBER=********<S>C=BE,CN=FIRSTNAME (Authentication),SN=LASTNAME,G=FIRSTNAME,SERIALNUMBER=***********"}
Note: you can get the X509 parameters (Issuer and Subject) by opening the certificate.
I hope this can help someone else with the same problem. And thanks again Mathias!
Upvotes: 1