Try 

for /F "delims=*" %i in ('dsquery * -filter
"(&(objectcategory=person)(objectclass=user)(memberof=<SourceGroupDN>))"
') @do dsmod group <TargetGroupDN> -addmbr %i 

(all at one line)

It could be that you have stumbled upon dsmod's limitation when it can
not have more than one DN piped in as a parameter.

Guy

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:ActiveDir-
> [EMAIL PROTECTED] On Behalf Of Thommes, Michael M.
> Sent: Thursday, June 23, 2005 11:48 PM
> To: ActiveDir@mail.activedir.org
> Subject: [ActiveDir] using adfind/admod or dsquery/dsmod to copy
members
> in a group
> 
> Hi,
>     Task - to copy members of an AD email distribution group to
another
> email distribution group
> 
> I have looked at both adfind and dsquery and while I can output all of
> the properties of the source email distribution group (including
> members), I can't see how to restrict the output just to members in
> order to pipe them to another email distribution group.
> 
> Any thoughts?
> 
> TIA,
> Mike Thommes
> List info   : http://www.activedir.org/List.aspx
> List FAQ    : http://www.activedir.org/ListFAQ.aspx
> List archive:
http://www.mail-archive.com/activedir%40mail.activedir.org/
List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

Reply via email to