I want to take a list of DNs (in users.txt) and remove them from all groups. I've got the following bit of code but it doesn't quite work.
Right now, the command evaluates like this, which clearly isn't correct.
I'm really...really terrible with the FOR command. I can't figure out how to get %%B to be the DN. Thanks.
FOR /F "delims=*" %%B in ("users.txt") do (DSQUERY GROUP -limit 0 | DSMOD GROUP -C -RMMBR %%B)
(DSQUERY GROUP -limit 0 | DSMOD GROUP -C -RMMBR C:\Documents and Settings\username\desktop\users.txt )