Storing of client IP address and username in srv_channel_users table in database in offline AD domain environment

I am creating a bot for my offline production environment. I want to keep tracking of AD username and client IP address in database. Please give some solutions or any alternatives if possible.