Full name of logged on user of active directory

(imported topic written by Braian)

How can i filter the relevance result to just get “
Bernard Test Jr.”

q:
if
(exists logged on users of
active directory)
then
distinguished name
of
(logged on users
whose
(name
of

it
= name
of
current user)
of
active directory)
else

if

exists
current users
then

“local user”

else

“none”

A: CN=Bernard Test Jr.,OU=Standard Users,OU=Surgeon_EDSA,DC=smgd,DC=ph

Thanks,

(imported comment written by liuhoting)

This needs a little cleanup but I think it works… but I’m assuming that results from that query always look like CN something OU something blah blah blah. I’m not sure if that’s actually the case…

Q: preceding text of first “OU=” of “CN=Bernard Test Jr.,OU=Standard Users,OU=Surgeon_EDSA,DC=smgd,DC=ph”

A: CN=Bernard Test Jr.,

Q: following text of first “CN=” of “CN=Bernard Test Jr.,”

A: Bernard Test Jr.,

T: 0.135 ms

and then you just combine the two of those…

Q: following text of first “CN=” of (preceding text of first “OU=” of “CN=Bernard Test Jr.,OU=Standard Users,OU=Surgeon_EDSA,DC=smgd,DC=ph”)

A: Bernard Test Jr.,

(imported comment written by Braian)

thanks
liuhoting