Answer the question
In order to leave comments, you need to log in
AD how to parse cn attribute?
How to take "Ivanovich" from the cn=Ivanov Ivan Ivanovich attribute, i.e. take only patronymic
Answer the question
In order to leave comments, you need to log in
PoShem, it's just a question of how standardized this attribute is for you. And so - this is a regular string, parse it by space, and after the second take it. Read up on string operations in the power shell. As an example:
$cn = (Get-ADUser -Properties cn).cn
$cn.Split(" ")[3]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question