How to remove Domain prefix from Username?

Gary Forsyth asked on September 17, 2019 23:00

Kentico Users are syncronised from our AD which works well but the Username is prefixed by our domain name which we don't want.

Example: SC-DDD (SC=domain & DDD=Username)

Can I simply schedule a SQL job to trim the "SC-" from all usernames in [CMS_User] table or will that break something? I see there's a UserGUID, so perhaps it doesn't matter if I modify the Username field?

If modifying the table data is not an option, are there any scripts I can modify to trim the domain before displaying the Username on pages?

Thanks, Gary

Recent Answers


Matúš Ušiak answered on September 18, 2019 10:28

Hi Gary, the domain name is added before the username by default and this cannot be changed. Kentico uses this to distinguish between and know whether the domain user exists or not. So to answer your question whether you can run SQL script to trim the domain from username, the answer is no.

When displaying the usernames on the live site however, or anywhere else, you can trim and modify them there. It however depends what exactly you're doing with them and how they are being displayed. Let me know what the use case is here and I can give you a more tailored answer.

0 votesVote for this answer Mark as a Correct answer

Gary Forsyth answered on September 18, 2019 20:41

Thanks for your reply. The domain-username is appearing in the 'Forum' module: Created by; Last Post; New Thread etc. Do those fields pass through a script that I can edit to trim away the domain?

Thanks, Gary

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.