Is there a VB script to remove a user from ALL security groups and distribution lists?

Hello...

Is there a VB script to remove a user from ALL security groups and distribution lists that he/she is a member of?
qvn7Asked:
Who is Participating?
 
Joseph MoodyBlogger and wearer of all hats.Commented:
Probably but if you are doing this to one user, why not do it by removing it from all groups it is a member of? Through the AD properties.
0
 
qvn7Author Commented:
It's just for testing purposes.
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
RobSampsonConnect With a Mentor Commented:
Hi, just so you know, the script that Jmoody10 has pointed to reads users logon IDs from a text file, and removes each user from all groups they are a member of (except the Primary Group).

Rob.
0
 
Glen KnightCommented:
I've requested that this question be deleted for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 
RobSampsonCommented:
I recommend that Jmoody10's comment ID 35167487 be accepted.  It will do the job.

Rob.
0
 
Glen KnightCommented:
You said in your comment "except the Primary Group" this means they will still be a member of that group and therefore not removed from "ALL" Grouos as per the request?
0
 
RobSampsonCommented:
But you can't remove a user from a primary group.  You must have one group set as the primary, and since there is no request to change the primary group, you can't do anything else with it.

Rob.
0
 
Robert MarleySinger / SongwriterCommented:
Starting the auto-close procedure on behalf of the Question Author, to implement the recommendations from the participating Expert(s).

-----
Everyt'ing is everyt'ing,

Mod_MarlEE
Community Support Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.