lists.arthurdejong.org
RSS feed

Re: How to extract user's OU from DN??

[Date Prev][Date Next] [Thread Prev][Thread Next]

Re: How to extract user's OU from DN??



Hi,

On 16.06.23 05:17, Chi Min Wang wrote:
Hello Everyone:
      Is there anyway to extract the user's first level of OU from DN??  I'd like to use it for mapping user's homedir(i.e. /home/$ou1/$cn). Thanks anyway!!
LINE_P2023616_110415.jpg


Something like this ?

echo $DN | sed -e 's/^.*[oO][uU]=/ou=/I;s/,.*$//'


hth

Henry