We use a lot of Active directory to integrate in our internal application. We often have a field like “Submitted by” where we end up putting the samAccountName of the user.
This seems great but there are odd occasions where the samAccountName of the user can change. This throws off the history of the tables in question.
How do you handle this type of situation?
- Use the ObjectGuid field?
- Use a readable custom field in AD that never changes? %%%
- I shouldn’t bother with this as the samAccountName rarely changes?
- Other??
%%% we technically do this right now. I’m trying to get away from this. When we create a new user, we put the samAccountName in a custom field in AD. This field value never changes even if the user’s samAccountName changes. I’m trying to get away from this as it is causing issue porting the applications to other companies (have to re-write that part of the code). I want to learn what other people are doing.
I would probably use
objectGUIDas the best option; that’s a value that really should not change at all.SIDmight be another option, but that can change, too, if the user is moved in the AD forest (at least in that case, the oldSIDwill be accessible in theSidHistoryattribute of that user)