There are dozens such scripts available online, do a search and find the one that best suits your needs. If you need someone to write the script for you, there are sites for that as well, don't expect people to respond to script requests here.
Here's a sample script I wrote a while back: https://www.michev.info/Blog/Post/2250/generating-a-report-of-users-group-membership-memberof-inventory
Feel free to modify it to take input from a CSV file. Also, don't use Name as the input value, as you can have multiple matching objects in the directory. Use a proper globally unique identifier such as UPN or PrimarySMTPAddress.