Variable Problem

:(Hi All

I have a different problem this time. My production team want to track employee of connecting server.

I want a script so that as user will try to connect server/network the code provided by them should be copy in a variable and later on I will put into a text file.

Or I will provide a program to connect server/network by asking code and password.

Thanks
Rajeev