Hi John,
You can use this command : Get-ADGroup GroupA -properties members | foreach 
{Add-ADGroupMember -id GroupB -MEMBERS ($_.Members) }
Best regards

From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On 
Behalf Of Marcum, John
Sent: mardi 22 juillet 2014 16:33
To: Scripting List (scripting@lists.myITforum.com)
Subject: [scripting] Copy all AD Group Members to Another Group

I'm sure this is really easy but.... I need to copy all of the users in Group A 
to Group B with PoSh. How do I do that?

I see that Get-ADGroup GroupA -properties members gets me all the members and 
Add-ADGroupMember -Identity GroupB would be used to add the members into the 
second group. How do I pipe the members out and in?




________________________________
        John Marcum
            MCITP, MCTS, MCSA
              Desktop Architect
   Bradley Arant Boult Cummings LLP
________________________________
      [H_Logo]


________________________________

Confidentiality Notice: This e-mail is from a law firm and may be protected by 
the attorney-client or work product privileges. If you have received this 
message in error, please notify the sender by replying to this e-mail and then 
delete it from your computer.




Reply via email to