I'm using PowerShell's Get-ADuser
to pull some curated attributes (more than basic but less the select *
).
Nothing too special, basically user created time, last log-on (required expression for that one I think), and a few others. Most are just simple property attribute returns. However, I also want to check for the presence UserSmmimeCert
.
By itself, it can be pulled, but the return is the value of the SMIME key, so it's hideously long. I don't need the key; I just want a return of true/false if the field is present or not. I have a way to do this if the ONLY field I want is the UserSmimeCertificate
(below), but I want it along side the other values I am pulling.
Get-ADUser -Identity $user -Properties userSmimeCertificate | select -ExpandProperty userSmimeCertificate) -is [System.Array]
So yeah, that will work as a one off, but I'm pulling about 10 property attributes back.
As a workaround option, I would also be happy if there was instead some way to say "just return the first x digits of the UserSmimeCertificate
".
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…