Flo
Flo

Reputation: 1671

Set Active Directory "Security Identity Mapping" / "Name Mapping" with C#/Powershell

I want to add a certificate to a user in the "Name Mapping" / "Security Identity Mapping" on Windows Server 2008R2 (active directory). Doing this with the GUI is easy, but I have a use-case where this is not possible.

I can access the regular fields like phone numbers from the powershell without a problem, but I have no Idea how to set this one.

I also tried another way with "IADSUser" in c#, but cant get that to work either.

What is the way to go here?

Upvotes: 2

Views: 1328

Answers (1)

John Bartels
John Bartels

Reputation: 2763

I believe the "Certificates" Parameter of the powershell command "New-ADUser" is what you are looking for:

http://technet.microsoft.com/en-us/library/ee617253.aspx

Here is a site that contains an example of creating a certificate in powershell, and then assigning that certificate to a new user using the "new-aduser" command. There is also an example that uses "Get-ADUser" to assign a certificate to an existing user.:

http://blogs.msdn.com/b/adpowershell/archive/2009/04/26/working-with-certificates.aspx

Upvotes: 2

Related Questions