Hey Scripting guys!
I am in serious trouble; I need to append X.509 certificates to an AD account, ASAP. Using the following script I can overwrite but I cant append, I need to keep any X.509 certs that are in the account alone. Using arrays I can pull the string from the first account and apply it to the second account. The problem is if there is an existing string, it gets overwritten. Can you guys help ?
$oguser = get-aduser Smith -Properties userPrincipalName,altSecurityIdentities $altsecid = $oguser.altSecurityIdentities $user = Get-ADUser AdminSmith -Properties userPrincipalName,altSecurityIdentities $user.altSecurityIdentities = $altsecid Set-ADUser -instance $user