How to audit user’s AD group membership?

How to audit user’s AD group membership?

Auditing is a normal part of IT specially in banking or card industries. With tools like Active Directory used to manage accesses to several applications, folders and computers in business domains it can branch quickly.

This script will generate a report in CSV, that will confirm or deny the presence of certain users in security groups.

Its only necessary to know the user login and the group names, in other words the SamAccountName.

The users and groups lists are saved in 2 separate TXT files, with one value per row.

There are 3 variables in the beginning of the script called $User_List which defines the user list source, $Group_List the group list and $Output_CSV where the output is saved to.