Forum Discussion
How to split specific character from Widows AD Name
- 4 years ago
Here you go:
UNam =
VAR Finddelimiter =
FIND ( "@", USERPRINCIPALNAME (), 1 )
VAR DomainName =
MID ( USERPRINCIPALNAME (), 1, Finddelimiter - 1 )
VAR FindDelimiterDot =
FIND ( ".", DomainName, 1 )
VAR FirstName =
MID ( DomainName, 1, FindDelimiterDot - 1 )
VAR LastNameInitial =
MID ( DomainName, FindDelimiterDot + 1, 1 )
RETURN
UPPER ( LEFT ( FirstName, 1 ) )
& RIGHT ( FirstName, LEN ( FirstName ) - 1 ) & " "
& UPPER ( LastNameInitial )
Thanks for the guidance.
I want to read only specific name who has logging in to the system which means AD user name..
Now i am getting "ct1net\201980" from logging into the system.
Using this id, i want to get the name of the specific user....
How to do this...?
- PC27904 years ago
Community Champion
Ok, Try this:
UName = VAR FindSlash = FIND("\",USERNAME(),1) return MID(USERNAME(),FindSlash+1,LEN(USERNAME()))- saivina29204 years ago
Post Prodigy
Ok..You are correct to get windows user name (It is windows user account id). But, It doesn't contain any user full name.
If we want to get user name from AD, I think "sn" is the field name.
Or
we can user userprincipalname. It contains mail id along with domain.
For example, USERPRINCIPALNAME is "[email protected]".
To get final user name we can use this mail id and split the name of the mail id.
Final Name is " Joseph J" is the result...
Is is possible from mail id ("[email protected]") to get the above name "Joseph J").
I think the above step is easy way to get the name of the user..
What is you suggestion pls...?
- PC27904 years ago
Community Champion
You can try this if it solves your purpose:
UNam = VAR Finddelimiter = FIND("@",USERPRINCIPALNAME(),1)returnMID(USERPRINCIPALNAME(),1,Finddelimiter-1)