Link to home
Start Free TrialLog in
Avatar of sedberg1
sedberg1

asked on

Script to delete a user

I have a very small script that pulls the group membership for a user:
dsget user UserDN -memberof

What I wanted to do was pull the results of that script, which are the group DNs, into some type of script that would remove the user from those groups.  This command will remove the user from the group.  But how would I get just one script to do all of it?
dsmod group GroupDN -rmmbr UserDN

Any suggestions would help.
Avatar of Toxacon
Toxacon
Flag of Finland image

I recommend using PowerShell (and PS scripts), which is good for cases like this.
ASKER CERTIFIED SOLUTION
Avatar of KenMcF
KenMcF
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial