Don't reference sAMAccountName when it does not exist

Ticket: #5163
Ticket: #5159
Ticket: #5015