Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone. I need a little help extracting a name from a text string (Active Directory DN). Here are a couple of examples.
I have: CN=Flintstone\, Fred,OU=Users,OU=Bedrock,OU=Enterprise,DC=na,DC=company,DC=com
I need: Flintstone, Fred
I have: CN=Jackson\, Samual L,OU=Users,OU=Hollywood,OU=Enterprise,DC=na,DC=company,DC=com
I need: Jackson, Samual L
Something like this:
=MID( YOUR_DIMENSION_NAME, 1, index( YOUR_DIMENSION_NAME, 'OU' ) )
First, index( YOUR_DIMENSION_NAME, 'OU' ), you take a position fisrt OU....
Second you take a piece, start at 1 position of string......and finish before fisrt OU (fisrt expression give this position)
Thanks Erico, that gets me close.
Actually, either of these yeilds the same result:
=MID( UserDN, 4, index( UserDN, ',OU' )-4 )
or
TextBetween(UserDN,'CN=',',OU')
The problem is that both of these still leave the "\" character after the last name: Flintstone\, Fred
You can use Replace (your result, '\', '')
Perfect!
The final answer: Replace(TextBetween(UserDN,'CN=',',OU'),'\','')