I have a script at the moment which will add users, update user attributes, move user account to a different OU and update the changed information. All this is using information in a SQL table [Table A]. Fields used are things like Dept, job title,site, login , etc.
The Dept,job title, and site fields are used to determine certain group membership. These will be referenced in a second table [table B].
What I need to happen is that I want the script to determine which groups a user is a member of, then check to see which groups the user should be a member of and then remove or add the user to these groups if need, if not needed it should remove them.
I need this to first check security groups and then to check distributiion groups. These are stored in the same way.
Could somebody please help me with this. I will give this the maximum amount of points I can but will increase these if the answer helps.