Hi guys, hope you are all well and can assist.
We want to work on a process of testing group membership scenarios.
Basically, we want to do the following:
1) User Bob is a member of 15 groups > Export all groups to a text file called exportedgroups.txt
2) Remove all groups from User Bob's account, except for domain users.
3) Do testing with User Bob's account.
4) After testing, readd all groups that were removed by step 2) above, back to user Bob's account.
Step 1) is done via:
dsquery user -name <username> -d <domainname> | dsget user -memberof > exportedgroups.txt
Format of exportedgroups.txt is as follows:
Step 2) is not done:
We need a way to remove all groups from his account EXCEPT for domain users.
Step 3) does not need to be done (we will do this).
Step 4) is not done.
Any help on this greatly appreciated.